summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_main.c
diff options
context:
space:
mode:
authorhasso <hasso>2004-11-25 19:33:48 +0000
committerhasso <hasso>2004-11-25 19:33:48 +0000
commitc065230a4c617a1cdf8813dd25384bcc9591f61a (patch)
tree42285fe5604e43ada3b53ac9a77ba1e3c4464b52 /ospf6d/ospf6_main.c
parentaccb156b9b1c3f4b46ab01f8850200f450fc40d8 (diff)
Make group to run daemon as configurable. Fixes #2 from Bugzilla #64.
Diffstat (limited to 'ospf6d/ospf6_main.c')
-rw-r--r--ospf6d/ospf6_main.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c
index 95086f2f..4563ece8 100644
--- a/ospf6d/ospf6_main.c
+++ b/ospf6d/ospf6_main.c
@@ -74,6 +74,8 @@ struct option longopts[] =
{ "pid_file", required_argument, NULL, 'i'},
{ "vty_addr", required_argument, NULL, 'A'},
{ "vty_port", required_argument, NULL, 'P'},
+ { "user", required_argument, NULL, 'u'},
+ { "group", required_argument, NULL, 'g'},
{ "version", no_argument, NULL, 'v'},
{ "help", no_argument, NULL, 'h'},
{ 0 }
@@ -109,6 +111,8 @@ Daemon which manages OSPF version 3.\n\n\
-i, --pid_file Set process identifier file name\n\
-A, --vty_addr Set vty's bind address\n\
-P, --vty_port Set vty's port number\n\
+-u, --user User to run as\n\
+-g, --group Group to run as\n\
-v, --version Print program version\n\
-h, --help Display this help and exit\n\
\n\
@@ -191,7 +195,7 @@ main (int argc, char *argv[], char *envp[])
/* Command line argument treatment. */
while (1)
{
- opt = getopt_long (argc, argv, "df:i:hp:A:P:u:v", longopts, 0);
+ opt = getopt_long (argc, argv, "df:i:hp:A:P:u:g:v", longopts, 0);
if (opt == EOF)
break;
@@ -224,8 +228,11 @@ main (int argc, char *argv[], char *envp[])
vty_port = (vty_port ? vty_port : OSPF6_VTY_PORT);
break;
case 'u':
- ospf6d_privs.user = ospf6d_privs.group = optarg;
+ ospf6d_privs.user = optarg;
break;
+ case 'g':
+ ospf6d_privs.group = optarg;
+ break;
case 'v':
print_version (progname);
exit (0);