aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/sysinstall/anonFTP.c
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1996-04-23 01:29:35 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1996-04-23 01:29:35 +0000
commit2113a60c4bd5fead694c80128f2ab2b7f9dc2333 (patch)
tree61dd517d68f78c02b32b70a1ec457f1509801e87 /usr.sbin/sysinstall/anonFTP.c
parent5553e30b4807af6bb735f8dc0ffd12b2766dd9f7 (diff)
downloadsrc-2113a60c4bd5fead694c80128f2ab2b7f9dc2333.tar.gz
src-2113a60c4bd5fead694c80128f2ab2b7f9dc2333.zip
Bring this into sync.
I still have a _very very annoying_ display bug which occurs when a menu item causes a submenu to be displayed - the screen repaints for the original menu (which is restored upon return from the submenu) are off by about 4 characters. I've tried restoring the screen, the cursor position, you name it - same deal. Grrrr! This commit is my first step in trying to get someone else to help me look into this one since I'm just tearing my hair out at this point!
Notes
Notes: svn path=/head/; revision=15355
Diffstat (limited to 'usr.sbin/sysinstall/anonFTP.c')
-rw-r--r--usr.sbin/sysinstall/anonFTP.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/usr.sbin/sysinstall/anonFTP.c b/usr.sbin/sysinstall/anonFTP.c
index 427e3f4454f1..f4f152cca5c4 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.10 1996/04/07 03:52:16 jkh Exp $
+ * $Id: anonFTP.c,v 1.11 1996/04/13 13:31:19 jkh Exp $
*
* Copyright (c) 1995
* Coranth Gryphon. All rights reserved.
@@ -211,7 +211,7 @@ createFtpUser(void)
}
/* This is it - how to get the setup values */
-int
+static int
anonftpOpenDialog(void)
{
WINDOW *ds_win;
@@ -405,9 +405,8 @@ configAnonFTP(dialogMenuItem *self)
dialog_clear();
i = anonftpOpenDialog();
if (i != DITEM_SUCCESS) {
- dialog_clear();
msgConfirm("Configuration of Anonymous FTP cancelled per user request.");
- return DITEM_SUCCESS;
+ return DITEM_SUCCESS | DITEM_RESTORE;
}
/*** Use defaults for any invalid values ***/
@@ -431,7 +430,7 @@ configAnonFTP(dialogMenuItem *self)
/*** If HomeDir does not exist, create it ***/
if (!directory_exists(tconf.homedir)) {
- vsystem("mkdir -p %s" ,tconf.homedir);
+ vsystem("mkdir -p %s", tconf.homedir);
}
if (directory_exists(tconf.homedir)) {
@@ -453,33 +452,25 @@ configAnonFTP(dialogMenuItem *self)
vsystem("chown -R %s.%s %s/pub", FTP_NAME, tconf.group, tconf.homedir);
}
else {
- dialog_clear();
msgConfirm("Unable to create FTP user! Anonymous FTP setup failed.");
i = DITEM_FAILURE;
}
- dialog_clear();
if (!msgYesNo("Create a welcome message file for anonymous FTP users?")) {
char cmd[256];
- WINDOW *w;
-
- w = savescr();
dialog_clear();
- msgNotify("Uncompressing the editor - please wait..");
vsystem("echo Your welcome message here. > %s/etc/%s", tconf.homedir, MOTD_FILE);
sprintf(cmd, "%s %s/etc/%s", variable_get(VAR_EDITOR), tconf.homedir, MOTD_FILE);
if (!systemExecute(cmd))
i = DITEM_SUCCESS;
else
i = DITEM_FAILURE;
- restorescr(w);
}
}
else {
- dialog_clear();
msgConfirm("Invalid Directory: %s\n"
"Anonymous FTP will not be set up.", tconf.homedir);
i = DITEM_FAILURE;
}
- return i;
+ return i | DITEM_RESTORE;
}