[master] 817b7f6 Move the defaults for ${user} and ${group} over with the other run-time determined defaults.
Poul-Henning Kamp
phk at varnish-cache.org
Tue Nov 12 12:38:49 CET 2013
commit 817b7f6033e45ae6b3012b70c9d1c26f624c7bdf
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Tue Nov 12 11:38:22 2013 +0000
Move the defaults for ${user} and ${group} over with the other
run-time determined defaults.
diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index 8b6fd82..820552f 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -36,6 +36,8 @@
#include <ctype.h>
#include <fcntl.h>
+#include <grp.h>
+#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -415,6 +417,12 @@ main(int argc, char * const *argv)
MCF_CollectParams();
+ /* If we have nobody/nogroup, use them as defaults */
+ if (getpwnam("nobody") != NULL)
+ MCF_SetDefault("user", "nobody");
+ if (getgrnam("nogroup") != NULL)
+ MCF_SetDefault("group", "nogroup");
+
if (sizeof(void *) < 8) {
/*
* Adjust default parameters for 32 bit systems to conserve
diff --git a/bin/varnishd/mgt/mgt_param.c b/bin/varnishd/mgt/mgt_param.c
index dcab5a2..131c70e 100644
--- a/bin/varnishd/mgt/mgt_param.c
+++ b/bin/varnishd/mgt/mgt_param.c
@@ -30,10 +30,7 @@
#include "config.h"
#include <ctype.h>
-#include <grp.h>
-#include <limits.h>
#include <math.h>
-#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -415,12 +412,6 @@ MCF_CollectParams(void)
MCF_AddParams(mgt_parspec);
MCF_AddParams(WRK_parspec);
MCF_AddParams(VSL_parspec);
-
- /* If we have nobody/nogroup, use them as defaults */
- if (getpwnam("nobody") != NULL)
- MCF_SetDefault("user", "nobody");
- if (getgrnam("nogroup") != NULL)
- MCF_SetDefault("group", "nogroup");
}
/*--------------------------------------------------------------------*/
More information about the varnish-commit
mailing list