From 9b1696b0022ef9f18abf518bdc1cb570a69e5a18 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Wed, 15 Jan 1997 03:57:50 +0000 Subject: [PATCH] Fix several problems: 1. Bus mouse selection didn't show up properly in mouse menu. 2. U&G management screen didn't respect cancel properly. 3. Novice not prompted to add users or set root password during installation. 4. Username length changes screw up user management form. --- release/sysinstall/config.c | 9 +++++++++ release/sysinstall/install.c | 16 ++++++++++++++++ release/sysinstall/menus.c | 2 +- release/sysinstall/sysinstall.h | 1 + release/sysinstall/user.c | 10 +++++----- usr.sbin/sade/config.c | 9 +++++++++ usr.sbin/sade/install.c | 16 ++++++++++++++++ usr.sbin/sade/menus.c | 2 +- usr.sbin/sade/sade.h | 1 + usr.sbin/sysinstall/config.c | 9 +++++++++ usr.sbin/sysinstall/install.c | 16 ++++++++++++++++ usr.sbin/sysinstall/menus.c | 2 +- usr.sbin/sysinstall/sysinstall.h | 1 + usr.sbin/sysinstall/user.c | 10 +++++----- 14 files changed, 91 insertions(+), 13 deletions(-) diff --git a/release/sysinstall/config.c b/release/sysinstall/config.c index 35accc7b7624..62af84a40a34 100644 --- a/release/sysinstall/config.c +++ b/release/sysinstall/config.c @@ -384,6 +384,15 @@ configNTP(dialogMenuItem *self) return status | DITEM_RESTORE; } +int +configUsers(dialogMenuItem *self) +{ + dialog_clear_norefresh(); + dmenuOpenSimple(&MenuUsermgmt, FALSE); + dialog_clear(); + return DITEM_SUCCESS | DITEM_RESTORE; +} + int configXFree86(dialogMenuItem *self) { diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c index 4db9e200ed02..15059e824e7b 100644 --- a/release/sysinstall/install.c +++ b/release/sysinstall/install.c @@ -600,6 +600,22 @@ installNovice(dialogMenuItem *self) "to browse the collection now?")) configPackages(self); + dialog_clear_norefresh(); + if (!msgYesNo("Would you like to add any initial user accounts to the system?\n" + "Adding at least one account for yourself at this stage is suggested\n" + "since working as the \"root\" user is dangerous (it is easy to do\n" + "things which adversely affect the entire system).")) + configUsers(self); + + dialog_clear_norefresh(); + if (!msgYesNo("Would you like to set the system manager's password now?\n\n" + "This is the password you'll use to log in as \"root\".")) { + WINDOW *w = savescr(); + + systemExecute("passwd root"); + restorescr(w); + } + /* XXX Put whatever other nice configuration questions you'd like to ask the user here XXX */ /* Give user the option of one last configuration spree */ diff --git a/release/sysinstall/menus.c b/release/sysinstall/menus.c index 5e597fa7463a..9b786df787c4 100644 --- a/release/sysinstall/menus.c +++ b/release/sysinstall/menus.c @@ -343,7 +343,7 @@ whichMouse(dialogMenuItem *self) if (!strcmp(self->prompt, "COM4")) return !strcmp(buf, "/dev/cuaa3"); if (!strcmp(self->prompt, "BusMouse")) - return !strcmp(buf, "/dev/msg0"); + return !strcmp(buf, "/dev/mse0"); if (!strcmp(self->prompt, "PS/2")) return !strcmp(buf, "/dev/psm0"); return FALSE; diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h index fad3d48b4805..199ce9c4c868 100644 --- a/release/sysinstall/sysinstall.h +++ b/release/sysinstall/sysinstall.h @@ -396,6 +396,7 @@ extern int configPackages(dialogMenuItem *self); extern int configSaver(dialogMenuItem *self); extern int configSaverTimeout(dialogMenuItem *self); extern int configNTP(dialogMenuItem *self); +extern int configUsers(dialogMenuItem *self); extern int configXFree86(dialogMenuItem *self); extern int configRouter(dialogMenuItem *self); extern int configSamba(dialogMenuItem *self); diff --git a/release/sysinstall/user.c b/release/sysinstall/user.c index 7257795a17e0..1c1775058dda 100644 --- a/release/sysinstall/user.c +++ b/release/sysinstall/user.c @@ -108,7 +108,7 @@ static Layout groupLayout[] = { /* The user configuration menu. */ static Layout userLayout[] = { #define LAYOUT_UNAME 0 - { 3, 6, UT_NAMESIZE + 4, UT_NAMESIZE, + { 3, 6, UT_NAMESIZE, UT_NAMESIZE + 1, "Login ID:", "The login name of the new user (mandatory)", uname, STRINGOBJ, NULL }, #define LAYOUT_UID 1 @@ -356,7 +356,7 @@ userAddGroup(dialogMenuItem *self) } /* Draw a group entry box */ - draw_box(ds_win, USER_DIALOG_Y + 2, USER_DIALOG_X + 8, USER_DIALOG_HEIGHT - 6, + draw_box(ds_win, USER_DIALOG_Y + 2, USER_DIALOG_X + 8, USER_DIALOG_HEIGHT - 8, USER_DIALOG_WIDTH - 17, dialog_attr, border_attr); wattrset(ds_win, dialog_attr); mvwaddstr(ds_win, USER_DIALOG_Y + 2, USER_DIALOG_X + 22, " Add a new group "); @@ -379,7 +379,7 @@ userAddGroup(dialogMenuItem *self) } } - if (!verifyGroupSettings()) + if (!cancel && !verifyGroupSettings()) goto reenter; /* Clear this crap off the screen */ @@ -678,7 +678,7 @@ userAddUser(dialogMenuItem *self) } /* Draw a user entry box */ - draw_box(ds_win, USER_DIALOG_Y + 1, USER_DIALOG_X + 3, USER_DIALOG_HEIGHT - 5, + draw_box(ds_win, USER_DIALOG_Y + 1, USER_DIALOG_X + 3, USER_DIALOG_HEIGHT - 6, USER_DIALOG_WIDTH - 6, dialog_attr, border_attr); wattrset(ds_win, dialog_attr); mvwaddstr(ds_win, USER_DIALOG_Y + 1, USER_DIALOG_X + 22, " Add a new user "); @@ -711,7 +711,7 @@ userAddUser(dialogMenuItem *self) } } - if (!verifyUserSettings(ds_win)) + if (!cancel && !verifyUserSettings(ds_win)) goto reenter; /* Clear this crap off the screen */ diff --git a/usr.sbin/sade/config.c b/usr.sbin/sade/config.c index 35accc7b7624..62af84a40a34 100644 --- a/usr.sbin/sade/config.c +++ b/usr.sbin/sade/config.c @@ -384,6 +384,15 @@ configNTP(dialogMenuItem *self) return status | DITEM_RESTORE; } +int +configUsers(dialogMenuItem *self) +{ + dialog_clear_norefresh(); + dmenuOpenSimple(&MenuUsermgmt, FALSE); + dialog_clear(); + return DITEM_SUCCESS | DITEM_RESTORE; +} + int configXFree86(dialogMenuItem *self) { diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c index 4db9e200ed02..15059e824e7b 100644 --- a/usr.sbin/sade/install.c +++ b/usr.sbin/sade/install.c @@ -600,6 +600,22 @@ installNovice(dialogMenuItem *self) "to browse the collection now?")) configPackages(self); + dialog_clear_norefresh(); + if (!msgYesNo("Would you like to add any initial user accounts to the system?\n" + "Adding at least one account for yourself at this stage is suggested\n" + "since working as the \"root\" user is dangerous (it is easy to do\n" + "things which adversely affect the entire system).")) + configUsers(self); + + dialog_clear_norefresh(); + if (!msgYesNo("Would you like to set the system manager's password now?\n\n" + "This is the password you'll use to log in as \"root\".")) { + WINDOW *w = savescr(); + + systemExecute("passwd root"); + restorescr(w); + } + /* XXX Put whatever other nice configuration questions you'd like to ask the user here XXX */ /* Give user the option of one last configuration spree */ diff --git a/usr.sbin/sade/menus.c b/usr.sbin/sade/menus.c index 5e597fa7463a..9b786df787c4 100644 --- a/usr.sbin/sade/menus.c +++ b/usr.sbin/sade/menus.c @@ -343,7 +343,7 @@ whichMouse(dialogMenuItem *self) if (!strcmp(self->prompt, "COM4")) return !strcmp(buf, "/dev/cuaa3"); if (!strcmp(self->prompt, "BusMouse")) - return !strcmp(buf, "/dev/msg0"); + return !strcmp(buf, "/dev/mse0"); if (!strcmp(self->prompt, "PS/2")) return !strcmp(buf, "/dev/psm0"); return FALSE; diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index fad3d48b4805..199ce9c4c868 100644 --- a/usr.sbin/sade/sade.h +++ b/usr.sbin/sade/sade.h @@ -396,6 +396,7 @@ extern int configPackages(dialogMenuItem *self); extern int configSaver(dialogMenuItem *self); extern int configSaverTimeout(dialogMenuItem *self); extern int configNTP(dialogMenuItem *self); +extern int configUsers(dialogMenuItem *self); extern int configXFree86(dialogMenuItem *self); extern int configRouter(dialogMenuItem *self); extern int configSamba(dialogMenuItem *self); diff --git a/usr.sbin/sysinstall/config.c b/usr.sbin/sysinstall/config.c index 35accc7b7624..62af84a40a34 100644 --- a/usr.sbin/sysinstall/config.c +++ b/usr.sbin/sysinstall/config.c @@ -384,6 +384,15 @@ configNTP(dialogMenuItem *self) return status | DITEM_RESTORE; } +int +configUsers(dialogMenuItem *self) +{ + dialog_clear_norefresh(); + dmenuOpenSimple(&MenuUsermgmt, FALSE); + dialog_clear(); + return DITEM_SUCCESS | DITEM_RESTORE; +} + int configXFree86(dialogMenuItem *self) { diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index 4db9e200ed02..15059e824e7b 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/sysinstall/install.c @@ -600,6 +600,22 @@ installNovice(dialogMenuItem *self) "to browse the collection now?")) configPackages(self); + dialog_clear_norefresh(); + if (!msgYesNo("Would you like to add any initial user accounts to the system?\n" + "Adding at least one account for yourself at this stage is suggested\n" + "since working as the \"root\" user is dangerous (it is easy to do\n" + "things which adversely affect the entire system).")) + configUsers(self); + + dialog_clear_norefresh(); + if (!msgYesNo("Would you like to set the system manager's password now?\n\n" + "This is the password you'll use to log in as \"root\".")) { + WINDOW *w = savescr(); + + systemExecute("passwd root"); + restorescr(w); + } + /* XXX Put whatever other nice configuration questions you'd like to ask the user here XXX */ /* Give user the option of one last configuration spree */ diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c index 5e597fa7463a..9b786df787c4 100644 --- a/usr.sbin/sysinstall/menus.c +++ b/usr.sbin/sysinstall/menus.c @@ -343,7 +343,7 @@ whichMouse(dialogMenuItem *self) if (!strcmp(self->prompt, "COM4")) return !strcmp(buf, "/dev/cuaa3"); if (!strcmp(self->prompt, "BusMouse")) - return !strcmp(buf, "/dev/msg0"); + return !strcmp(buf, "/dev/mse0"); if (!strcmp(self->prompt, "PS/2")) return !strcmp(buf, "/dev/psm0"); return FALSE; diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index fad3d48b4805..199ce9c4c868 100644 --- a/usr.sbin/sysinstall/sysinstall.h +++ b/usr.sbin/sysinstall/sysinstall.h @@ -396,6 +396,7 @@ extern int configPackages(dialogMenuItem *self); extern int configSaver(dialogMenuItem *self); extern int configSaverTimeout(dialogMenuItem *self); extern int configNTP(dialogMenuItem *self); +extern int configUsers(dialogMenuItem *self); extern int configXFree86(dialogMenuItem *self); extern int configRouter(dialogMenuItem *self); extern int configSamba(dialogMenuItem *self); diff --git a/usr.sbin/sysinstall/user.c b/usr.sbin/sysinstall/user.c index 7257795a17e0..1c1775058dda 100644 --- a/usr.sbin/sysinstall/user.c +++ b/usr.sbin/sysinstall/user.c @@ -108,7 +108,7 @@ static Layout groupLayout[] = { /* The user configuration menu. */ static Layout userLayout[] = { #define LAYOUT_UNAME 0 - { 3, 6, UT_NAMESIZE + 4, UT_NAMESIZE, + { 3, 6, UT_NAMESIZE, UT_NAMESIZE + 1, "Login ID:", "The login name of the new user (mandatory)", uname, STRINGOBJ, NULL }, #define LAYOUT_UID 1 @@ -356,7 +356,7 @@ userAddGroup(dialogMenuItem *self) } /* Draw a group entry box */ - draw_box(ds_win, USER_DIALOG_Y + 2, USER_DIALOG_X + 8, USER_DIALOG_HEIGHT - 6, + draw_box(ds_win, USER_DIALOG_Y + 2, USER_DIALOG_X + 8, USER_DIALOG_HEIGHT - 8, USER_DIALOG_WIDTH - 17, dialog_attr, border_attr); wattrset(ds_win, dialog_attr); mvwaddstr(ds_win, USER_DIALOG_Y + 2, USER_DIALOG_X + 22, " Add a new group "); @@ -379,7 +379,7 @@ userAddGroup(dialogMenuItem *self) } } - if (!verifyGroupSettings()) + if (!cancel && !verifyGroupSettings()) goto reenter; /* Clear this crap off the screen */ @@ -678,7 +678,7 @@ userAddUser(dialogMenuItem *self) } /* Draw a user entry box */ - draw_box(ds_win, USER_DIALOG_Y + 1, USER_DIALOG_X + 3, USER_DIALOG_HEIGHT - 5, + draw_box(ds_win, USER_DIALOG_Y + 1, USER_DIALOG_X + 3, USER_DIALOG_HEIGHT - 6, USER_DIALOG_WIDTH - 6, dialog_attr, border_attr); wattrset(ds_win, dialog_attr); mvwaddstr(ds_win, USER_DIALOG_Y + 1, USER_DIALOG_X + 22, " Add a new user "); @@ -711,7 +711,7 @@ userAddUser(dialogMenuItem *self) } } - if (!verifyUserSettings(ds_win)) + if (!cancel && !verifyUserSettings(ds_win)) goto reenter; /* Clear this crap off the screen */