summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall/user.c
diff options
context:
space:
mode:
authormurray <murray@FreeBSD.org>2000-04-08 03:08:12 +0000
committermurray <murray@FreeBSD.org>2000-04-08 03:08:12 +0000
commit85756749874e1f8197af249cdd63540464fb683f (patch)
tree3edf12e6ddb52e54d97423d42a43692a8b65900c /usr.sbin/sysinstall/user.c
parent025b04375037348440374732629c25661831a0b0 (diff)
downloadFreeBSD-src-85756749874e1f8197af249cdd63540464fb683f.zip
FreeBSD-src-85756749874e1f8197af249cdd63540464fb683f.tar.gz
More error checking and idiot-proofing for the user editor.
PR: 14318 Approved by: jkh
Diffstat (limited to 'usr.sbin/sysinstall/user.c')
-rw-r--r--usr.sbin/sysinstall/user.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/usr.sbin/sysinstall/user.c b/usr.sbin/sysinstall/user.c
index 372d3fb..f91087e 100644
--- a/usr.sbin/sysinstall/user.c
+++ b/usr.sbin/sysinstall/user.c
@@ -421,6 +421,10 @@ verifyUserSettings(WINDOW *ds_win)
return 0;
}
}
+ if ((homedir[0]!=0) && (homedir[0]!='/')) {
+ feepout("The pathname for home directories must begin with a '/'.");
+ return 0;
+ }
if (strlen(shell) > 0) {
while((cp = getusershell()) != NULL)
if (strcmp(cp, shell) == 0)
@@ -655,7 +659,7 @@ userAddUser(dialogMenuItem *self)
WINDOW *ds_win, *save;
ComposeObj *obj = NULL;
int n = 0, cancel = FALSE, ret;
- int max, firsttime = TRUE;
+ int max, firsttime = TRUE, filled=0;
if (RunningAsInit && !strstr(variable_get(SYSTEM_STATE), "install")) {
msgConfirm("This option may only be used after the system is installed, sorry!");
@@ -705,7 +709,17 @@ reenter:
firsttime = FALSE;
}
- while (layoutDialogLoop(ds_win, userLayout, &obj, &n, max, &cancelbutton, &cancel));
+ while (layoutDialogLoop(ds_win, userLayout, &obj, &n, max, &cancelbutton, &cancel)) {
+ /* Prevent this from being irritating if user really means NO */
+ if (filled < 3) {
+ if ((uname[0]) && !homedir[0]) {
+ SAFE_STRCPY(homedir,"/home/");
+ strcat(homedir,uname);
+ RefreshStringObj(userLayout[LAYOUT_HOMEDIR].obj);
+ ++filled;
+ }
+ }
+ };
if (!cancel && !verifyUserSettings(ds_win))
goto reenter;
OpenPOWER on IntegriCloud