summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall/anonFTP.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-04-28 03:27:26 +0000
committerjkh <jkh@FreeBSD.org>1996-04-28 03:27:26 +0000
commitbef4595dff61c4da60fe242b7e3e6837f7652fe8 (patch)
tree3ea5bbe8ec61c1ac0d4dc65e282de55573fb8a67 /usr.sbin/sysinstall/anonFTP.c
parent87634a8e4d491f936c98dc09903764bef2a2cc76 (diff)
downloadFreeBSD-src-bef4595dff61c4da60fe242b7e3e6837f7652fe8.zip
FreeBSD-src-bef4595dff61c4da60fe242b7e3e6837f7652fe8.tar.gz
Fix an ancient index list bug.
Make FTP re-initializion work. Fix fix fix.
Diffstat (limited to 'usr.sbin/sysinstall/anonFTP.c')
-rw-r--r--usr.sbin/sysinstall/anonFTP.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.sbin/sysinstall/anonFTP.c b/usr.sbin/sysinstall/anonFTP.c
index 436d27f..591589f 100644
--- a/usr.sbin/sysinstall/anonFTP.c
+++ b/usr.sbin/sysinstall/anonFTP.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: anonFTP.c,v 1.12 1996/04/23 01:29:07 jkh Exp $
+ * $Id: anonFTP.c,v 1.13 1996/04/28 01:07:19 jkh Exp $
*
* Copyright (c) 1995
* Coranth Gryphon. All rights reserved.
@@ -206,7 +206,6 @@ createFtpUser(void)
fclose(fptr);
msgNotify("Remaking password file: %s", _PATH_MASTERPASSWD);
vsystem("pwd_mkdb -p %s", _PATH_MASTERPASSWD);
-
return (DITEM_SUCCESS);
}
@@ -404,9 +403,9 @@ configAnonFTP(dialogMenuItem *self)
dialog_clear();
i = anonftpOpenDialog();
- if (i != DITEM_SUCCESS) {
+ if (DITEM_STATUS(i) != DITEM_SUCCESS) {
msgConfirm("Configuration of Anonymous FTP cancelled per user request.");
- return DITEM_SUCCESS | DITEM_RESTORE;
+ return i | DITEM_RESTORE;
}
/*** Use defaults for any invalid values ***/
@@ -421,8 +420,8 @@ configAnonFTP(dialogMenuItem *self)
/*** If the user did not specify a directory, use default ***/
- if (tconf.homedir[strlen(tconf.homedir)-1] == '/')
- tconf.homedir[strlen(tconf.homedir)-1] = '\0';
+ if (tconf.homedir[strlen(tconf.homedir) - 1] == '/')
+ tconf.homedir[strlen(tconf.homedir) - 1] = '\0';
if (!tconf.homedir[0])
strcpy(tconf.homedir, FTP_HOMEDIR);
@@ -443,7 +442,7 @@ configAnonFTP(dialogMenuItem *self)
vsystem("mkdir -p %s/%s", tconf.homedir, tconf.upload);
vsystem("chmod 1777 %s/%s", tconf.homedir, tconf.upload);
- if (createFtpUser() == DITEM_SUCCESS) {
+ if (DITEM_STATUS(createFtpUser()) == DITEM_SUCCESS) {
msgNotify("Copying password information for anon FTP.");
vsystem("cp /etc/pwd.db %s/etc && chmod 444 %s/etc/pwd.db", tconf.homedir, tconf.homedir);
vsystem("cp /etc/passwd %s/etc && chmod 444 %s/etc/passwd", tconf.homedir, tconf.homedir);
@@ -471,5 +470,7 @@ configAnonFTP(dialogMenuItem *self)
"Anonymous FTP will not be set up.", tconf.homedir);
i = DITEM_FAILURE;
}
+ if (DITEM_STATUS(i) == DITEM_SUCCESS)
+ variable_set2("anon_ftp", "YES");
return i | DITEM_RESTORE;
}
OpenPOWER on IntegriCloud