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_3_0_0_beta0~430 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41960ed2aa646282f884889f243979e6f8ad11f4;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 736c564d1a3..437ed8dbdc8 100644 --- a/src/main/radwho.c +++ b/src/main/radwho.c @@ -270,6 +270,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"); @@ -318,7 +319,7 @@ int main(int argc, char **argv) raddb_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': raddb_dir = optarg; break; @@ -326,6 +327,9 @@ int main(int argc, char **argv) fingerd++; showname = 0; break; + case 'F': + radutmp_file = optarg; + break; case 'h': usage(0); break; @@ -400,6 +404,8 @@ int main(int argc, char **argv) exit(0); /* don't bother printing anything else */ } + if (radutmp_file) goto have_radutmp; + /* * Initialize mainconfig */ @@ -415,7 +421,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]); @@ -427,6 +433,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". */