From: Alan T. DeKok Date: Mon, 26 Dec 2011 17:37:38 +0000 (-0500) Subject: Add and document -F radutmp_file X-Git-Tag: release_2_2_0~220 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed5a4e3625d8cb2355b6ed7db8ec98f7d73274e2;p=thirdparty%2Ffreeradius-server.git Add and document -F radutmp_file --- diff --git a/man/man1/radwho.1 b/man/man1/radwho.1 index ed754688105..c94fae8d13b 100644 --- a/man/man1/radwho.1 +++ b/man/man1/radwho.1 @@ -1,4 +1,4 @@ -.TH RADWHO 1 "7 April 2005" "" "FreeRADIUS Daemon" +.TH RADWHO 1 "26 Dec 2011" "" "FreeRADIUS Daemon" .SH NAME radwho - show online users .SH SYNOPSIS @@ -7,6 +7,8 @@ radwho - show online users .RB [ \-d .IR raddb_directory ] .RB [ \-f ] +.RB [ \-F +.IR radutmp_file ] .RB [ \-i ] .RB [ \-n ] .RB [ \-N @@ -36,6 +38,9 @@ The directory that contains the RADIUS configuration files. Defaults to .IP \-f Behave as the 'fingerd' daemon - waits for one line of input, then prints the output with lines \\r\\n terminated. +.IP \-F\ \fIradutmp_file\fP +The file that contains the radutmp file. If this is specified, -d is +not necessary. .IP \-i Shows the session ID instead of the full name. .IP \-n diff --git a/src/main/radwho.c b/src/main/radwho.c index c9d8ea7940e..076113a129b 100644 --- a/src/main/radwho.c +++ b/src/main/radwho.c @@ -269,6 +269,7 @@ static void NEVER_RETURNS usage(int status) fprintf(output, " -d: set the raddb directory (default is %s)\n", RADIUS_DIR); fprintf(output, " -f: give fingerd output\n"); + fprintf(output, " -F : Use radutmp \n"); fprintf(output, " -i: show session ID\n"); fprintf(output, " -n: no full name\n"); fprintf(output, " -N : Show entries matching the given NAS IP address\n"); @@ -317,7 +318,7 @@ int main(int argc, char **argv) radius_dir = RADIUS_DIR; - while((c = getopt(argc, argv, "d:fnN:sSipP:crRu:U:Z")) != EOF) switch(c) { + while((c = getopt(argc, argv, "d:fF:nN:sSipP:crRu:U:Z")) != EOF) switch(c) { case 'd': radius_dir = optarg; break; @@ -325,6 +326,9 @@ int main(int argc, char **argv) fingerd++; showname = 0; break; + case 'F': + radutmp_file = optarg; + break; case 'h': usage(0); break; @@ -399,6 +403,8 @@ int main(int argc, char **argv) exit(0); /* don't bother printing anything else */ } + if (radutmp_file) goto have_radutmp; + /* * Initialize mainconfig */ @@ -414,7 +420,7 @@ int main(int argc, char **argv) } /* Read the radutmp section of radiusd.conf */ - cs = cf_section_sub_find(cf_section_sub_find(maincs, "modules"), "radutmp"); + cs = cf_section_find_name2(cf_section_sub_find(maincs, "modules"), "radutmp", NULL); if(!cs) { fprintf(stderr, "%s: No configuration information in radutmp section of radiusd.conf!\n", argv[0]); @@ -426,6 +432,7 @@ int main(int argc, char **argv) /* Assign the correct path for the radutmp file */ radutmp_file = radutmpconfig.radutmp_fn; + have_radutmp: /* * See if we are "fingerd". */