summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade/config.c
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2003-01-07 07:46:50 +0000
committerscottl <scottl@FreeBSD.org>2003-01-07 07:46:50 +0000
commitd8ff7fe878a3e835f1247449f4fe7098813adb7b (patch)
tree492f467123d0c6570bf96778c2a7c7f194a7f711 /usr.sbin/sade/config.c
parent4a33e2dc689503644b7bb2a07f995f09bc925aa7 (diff)
downloadFreeBSD-src-d8ff7fe878a3e835f1247449f4fe7098813adb7b.zip
FreeBSD-src-d8ff7fe878a3e835f1247449f4fe7098813adb7b.tar.gz
Teach sysinstall about rpcbind, rpc.lockd, and rpc.statd. As an added
bonus, rpcbind will be enabled automatically if rpc.lockd, rpc.statd, amd, NFS Server, or NIS is enabled.
Diffstat (limited to 'usr.sbin/sade/config.c')
-rw-r--r--usr.sbin/sade/config.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/usr.sbin/sade/config.c b/usr.sbin/sade/config.c
index 8a3b30f..0edeed4 100644
--- a/usr.sbin/sade/config.c
+++ b/usr.sbin/sade/config.c
@@ -964,6 +964,7 @@ int
configNFSServer(dialogMenuItem *self)
{
char cmd[256];
+ int retval = 0;
/* If we're an NFS server, we need an exports file */
if (!file_readable("/etc/exports")) {
@@ -994,13 +995,38 @@ configNFSServer(dialogMenuItem *self)
systemExecute(cmd);
}
variable_set2(VAR_NFS_SERVER, "YES", 1);
+ retval = configRpcBind(NULL);
restorescr(w);
}
else if (variable_get(VAR_NFS_SERVER)) { /* We want to turn it off again? */
vsystem("mv -f /etc/exports /etc/exports.disabled");
variable_unset(VAR_NFS_SERVER);
}
- return DITEM_SUCCESS;
+ return DITEM_SUCCESS | retval;
+}
+
+/*
+ * Extend the standard dmenuToggleVariable() method to also check and set
+ * the rpcbind variable if needed.
+ */
+int
+configRpcBind(dialogMenuItem *self)
+{
+ int retval = 0;
+ int doupdate = 1;
+
+ if (self != NULL) {
+ retval = dmenuToggleVariable(self);
+ if (strcmp(variable_get(self->data), "YES") != 0)
+ doupdate = 0;
+ }
+
+ if (doupdate && strcmp(variable_get(VAR_RPCBIND_ENABLE), "YES") != 0) {
+ variable_set2(VAR_RPCBIND_ENABLE, "YES", 1);
+ retval |= DITEM_REDRAW;
+ }
+
+ return retval;
}
int
OpenPOWER on IntegriCloud