summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>2000-12-14 02:49:02 +0000
committerjkh <jkh@FreeBSD.org>2000-12-14 02:49:02 +0000
commitc8394629dce8024ccb9d10490623035b757c034b (patch)
tree8b1e5ad94d0002f9b6fdae7211a93c59006db6cb /usr.sbin/sade
parent41a7e78c6b5ace25de009b8707f66f8543288720 (diff)
downloadFreeBSD-src-c8394629dce8024ccb9d10490623035b757c034b.zip
FreeBSD-src-c8394629dce8024ccb9d10490623035b757c034b.tar.gz
Adapt sysinstall to use the new msgNoYes() function which assumes
no as a default. Sysinstall should be both less dangerous and less annoying as a result of this change, though that's just my opinion (since they're the defaults which annoy ME the least :).
Diffstat (limited to 'usr.sbin/sade')
-rw-r--r--usr.sbin/sade/disks.c6
-rw-r--r--usr.sbin/sade/install.c22
-rw-r--r--usr.sbin/sade/label.c6
-rw-r--r--usr.sbin/sade/main.c4
-rw-r--r--usr.sbin/sade/msg.c24
-rw-r--r--usr.sbin/sade/sade.h1
-rw-r--r--usr.sbin/sade/system.c2
7 files changed, 44 insertions, 21 deletions
diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c
index e93ff5a..ce05ea0 100644
--- a/usr.sbin/sade/disks.c
+++ b/usr.sbin/sade/disks.c
@@ -528,7 +528,7 @@ diskPartition(Device *dev)
msgConfirm("You've already written this information out - you\n"
"can't undo it.");
}
- else if (!msgYesNo("Are you SURE you want to Undo everything?")) {
+ else if (!msgNoYes("Are you SURE you want to Undo everything?")) {
char cp[BUFSIZ];
sstrncpy(cp, d->name, sizeof cp);
@@ -546,7 +546,7 @@ diskPartition(Device *dev)
break;
case 'W':
- if (!msgYesNo("WARNING: This should only be used when modifying an EXISTING\n"
+ if (!msgNoYes("WARNING: This should only be used when modifying an EXISTING\n"
"installation. If you are installing FreeBSD for the first time\n"
"then you should simply type Q when you're finished here and your\n"
"changes will be committed in one batch automatically at the end of\n"
@@ -599,7 +599,7 @@ diskPartition(Device *dev)
break;
case '|':
- if (!msgYesNo("Are you SURE you want to go into Wizard mode?\n"
+ if (!msgNoYes("Are you SURE you want to go into Wizard mode?\n"
"No seat belts whatsoever are provided!")) {
clear();
refresh();
diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c
index a2bf9bd..14a0776 100644
--- a/usr.sbin/sade/install.c
+++ b/usr.sbin/sade/install.c
@@ -567,31 +567,29 @@ nodisks:
dialog_clear_norefresh();
}
- if (msgYesNo("Will this machine be a leaf node (e.g. will not forward packets\n"
- "between interfaces)?"))
+ if (!msgNoYes("Do you want this machine to function as a network gateway?"))
variable_set2("gateway_enable", "YES", 1);
dialog_clear_norefresh();
- if (msgYesNo("Do you want to grant only normal users FTP access to this\n"
- "host (e.g. no anonymous FTP connections)?"))
+ if (!msgNoYes("Do you want to have anonymous FTP access to this machine?"))
configAnonFTP(self);
dialog_clear_norefresh();
- if (!msgYesNo("Do you want to configure this machine as an NFS server?"))
+ if (!msgNoYes("Do you want to configure this machine as an NFS server?"))
configNFSServer(self);
dialog_clear_norefresh();
- if (!msgYesNo("Do you want to configure this machine as an NFS client?"))
+ if (!msgNoYes("Do you want to configure this machine as an NFS client?"))
variable_set2("nfs_client_enable", "YES", 1);
- if (!msgYesNo("Do you want to select a default security profile for\n"
+ if (!msgNoYes("Do you want to select a default security profile for\n"
"this host (select No for \"medium\" security)?"))
configSecurityProfile(self);
else
configSecurityModerate(self);
dialog_clear_norefresh();
- if (!msgYesNo("Would you like to customize your system console settings?"))
+ if (!msgNoYes("Would you like to customize your system console settings?"))
dmenuOpenSimple(&MenuSyscons, FALSE);
dialog_clear_norefresh();
@@ -605,7 +603,7 @@ nodisks:
#endif
dialog_clear_norefresh();
- if (!msgYesNo("Does this system have a non-USB mouse attached to it?"))
+ if (!msgNoYes("Does this system have a USB mouse attached to it?"))
dmenuOpenSimple(&MenuMouse, FALSE);
/* Now would be a good time to checkpoint the configuration data */
@@ -731,7 +729,7 @@ static void
installConfigure(void)
{
/* Final menu of last resort */
- if (!msgYesNo("Visit the general configuration menu for a chance to set\n"
+ if (!msgNoYes("Visit the general configuration menu for a chance to set\n"
"any last options?"))
dmenuOpenSimple(&MenuConfigure, FALSE);
configRC_conf();
@@ -908,7 +906,7 @@ installFilesystems(dialogMenuItem *self)
if (strcmp(root->mountpoint, "/"))
msgConfirm("Warning: %s is marked as a root partition but is mounted on %s", rootdev->name, root->mountpoint);
- if (root->newfs && (!upgrade || !msgYesNo("You are upgrading - are you SURE you want to newfs the root partition?"))) {
+ if (root->newfs && (!upgrade || !msgNoYes("You are upgrading - are you SURE you want to newfs the root partition?"))) {
int i;
dialog_clear_norefresh();
@@ -970,7 +968,7 @@ installFilesystems(dialogMenuItem *self)
if (c2 == rootdev)
continue;
- if (tmp->newfs && (!upgrade || !msgYesNo("You are upgrading - are you SURE you want to newfs /dev/%s?", c2->name)))
+ if (tmp->newfs && (!upgrade || !msgNoYes("You are upgrading - are you SURE you want to newfs /dev/%s?", c2->name)))
command_shell_add(tmp->mountpoint, "%s %s/dev/%s", tmp->newfs_cmd, RunningAsInit ? "/mnt" : "", c2->name);
else
command_shell_add(tmp->mountpoint, "fsck -y %s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name);
diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c
index db5061a..952b6b2 100644
--- a/usr.sbin/sade/label.c
+++ b/usr.sbin/sade/label.c
@@ -1078,7 +1078,7 @@ diskLabel(Device *dev)
msgConfirm("You've already written out your changes -\n"
"it's too late to undo!");
}
- else if (!msgYesNo("Are you SURE you want to Undo everything?")) {
+ else if (!msgNoYes("Are you SURE you want to Undo everything?")) {
variable_unset(DISK_PARTITIONED);
variable_unset(DISK_LABELLED);
for (i = 0; devs[i]; i++) {
@@ -1103,7 +1103,7 @@ diskLabel(Device *dev)
"wish to overwrite them, you'll have to start this\n"
"procedure again from the beginning.");
}
- else if (!msgYesNo("WARNING: This should only be used when modifying an EXISTING\n"
+ else if (!msgNoYes("WARNING: This should only be used when modifying an EXISTING\n"
"installation. If you are installing FreeBSD for the first time\n"
"then you should simply type Q when you're finished here and your\n"
"changes will be committed in one batch automatically at the end of\n"
@@ -1116,7 +1116,7 @@ diskLabel(Device *dev)
break;
case '|':
- if (!msgYesNo("Are you sure you want to go into Wizard mode?\n\n"
+ if (!msgNoYes("Are you sure you want to go into Wizard mode?\n\n"
"This is an entirely undocumented feature which you are not\n"
"expected to understand!")) {
int i;
diff --git a/usr.sbin/sade/main.c b/usr.sbin/sade/main.c
index 67de905..19196b3 100644
--- a/usr.sbin/sade/main.c
+++ b/usr.sbin/sade/main.c
@@ -149,9 +149,9 @@ main(int argc, char **argv)
dmenuOpen(&MenuInitial, &choice, &scroll, &curr, &max, TRUE);
if (getpid() != 1
#ifdef __alpha__
- || !msgYesNo("Are you sure you wish to exit? The system will halt.")
+ || !msgNoYes("Are you sure you wish to exit? The system will halt.")
#else
- || !msgYesNo("Are you sure you wish to exit? The system will reboot\n"
+ || !msgNoYes("Are you sure you wish to exit? The system will reboot\n"
"(be sure to remove any floppies/CDROMs from the drives).")
#endif
)
diff --git a/usr.sbin/sade/msg.c b/usr.sbin/sade/msg.c
index 19e16c5..a027905 100644
--- a/usr.sbin/sade/msg.c
+++ b/usr.sbin/sade/msg.c
@@ -242,6 +242,30 @@ msgYesNo(char *fmt, ...)
return ret;
}
+/* Put up a message in a popup no/yes box and return 1 for YES, 0 for NO */
+int
+msgNoYes(char *fmt, ...)
+{
+ va_list args;
+ char *errstr;
+ int ret;
+ WINDOW *w = savescr();
+
+ errstr = (char *)alloca(FILENAME_MAX);
+ va_start(args, fmt);
+ vsnprintf(errstr, FILENAME_MAX, fmt, args);
+ va_end(args);
+ use_helpline(NULL);
+ use_helpfile(NULL);
+ if (OnVTY) {
+ ioctl(0, VT_ACTIVATE, 1); /* Switch back */
+ msgInfo(NULL);
+ }
+ ret = dialog_noyes("User Confirmation Requested", errstr, -1, -1);
+ restorescr(w);
+ return ret;
+}
+
/* Put up a message in an input box and return the value */
char *
msgGetInput(char *buf, char *fmt, ...)
diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h
index 4869909..ecbbfc1 100644
--- a/usr.sbin/sade/sade.h
+++ b/usr.sbin/sade/sade.h
@@ -687,6 +687,7 @@ extern void msgConfirm(char *fmt, ...);
extern void msgNotify(char *fmt, ...);
extern void msgWeHaveOutput(char *fmt, ...);
extern int msgYesNo(char *fmt, ...);
+extern int msgNoYes(char *fmt, ...);
extern char *msgGetInput(char *buf, char *fmt, ...);
extern int msgSimpleConfirm(char *);
extern int msgSimpleNotify(char *);
diff --git a/usr.sbin/sade/system.c b/usr.sbin/sade/system.c
index e2a36eb..29399b9 100644
--- a/usr.sbin/sade/system.c
+++ b/usr.sbin/sade/system.c
@@ -434,7 +434,7 @@ systemCreateHoloshell(void)
if (kill(ehs_pid, 0) == 0) {
- if (msgYesNo("There seems to be an emergency holographic shell\n"
+ if (msgNoYes("There seems to be an emergency holographic shell\n"
"already running on VTY 4.\n\n"
"Kill it and start a new one?"))
return;
OpenPOWER on IntegriCloud