Index: libexec/fingerd/fingerd.8 =================================================================== RCS file: /home/ncvs/src/libexec/fingerd/fingerd.8,v retrieving revision 1.8 diff -u -r1.8 fingerd.8 --- libexec/fingerd/fingerd.8 10 Aug 2001 13:45:21 -0000 1.8 +++ libexec/fingerd/fingerd.8 18 Jun 2002 11:19:13 -0000 @@ -32,7 +32,7 @@ .\" @(#)fingerd.8 8.1 (Berkeley) 6/4/93 .\" $FreeBSD: src/libexec/fingerd/fingerd.8,v 1.8 2001/08/10 13:45:21 ru Exp $ .\" -.Dd June 4, 1993 +.Dd June 18, 2002 .Dt FINGERD 8 .Os .Sh NAME @@ -42,6 +42,11 @@ .Nm .Op Fl s .Op Fl l +.Op Fl h +.Op Fl m +.Op Fl P +.Op Fl S +.Op Fl g .Op Fl p Ar filename .Sh DESCRIPTION .Nm Fingerd @@ -97,15 +102,27 @@ as server program arguments in .Pa /etc/inetd.conf : .Bl -tag -width indent -.It Fl s -Enable secure mode. -Queries without a user name are rejected and -forwarding of queries to other remote hosts is denied. +.It Fl g +Do not show any gecos information besides the users' real names. When +used in conjunction with the +.Fl h +option, it also has the side-effect of restricting output of the +host name from which the user is connected. +.It Fl h +Display the name of the remote host in short mode, +instead of the office location and office phone. .It Fl l Enable logging. The name of the host originating the query is reported via .Xr syslog 3 at LOG_NOTICE priority. +.It Fl m +Prevent matching of +.Ar user +names. +.Ar User +is usually a login name; however, matching will also be done on the +users' real names, unless this option is supplied. .It Fl p Use an alternate program as the local information provider. The default local program @@ -117,6 +134,25 @@ this option allows a system manager to have more control over what information is provided to remote sites. +.It Fl s +Enable secure mode. +Queries without a user name are rejected and +forwarding of queries to other remote hosts is denied. +.It Fl P +Prevents +.Xr finger 1 +from displaying the contents of the +.Dq Pa .plan , +.Dq Pa .project , +.Dq Pa .pubkey +and +.Dq Pa .forward +files. +.It Fl S +Prints user information in short mode, one line per user. +This overrides the +.Dq Pa Whois switch +that may be passed in from the remote client. .El .Sh SEE ALSO .Xr finger 1 , Index: libexec/fingerd/fingerd.c =================================================================== RCS file: /home/ncvs/src/libexec/fingerd/fingerd.c,v retrieving revision 1.21 diff -u -r1.21 fingerd.c --- libexec/fingerd/fingerd.c 30 May 2002 21:35:39 -0000 1.21 +++ libexec/fingerd/fingerd.c 18 Jun 2002 10:08:48 -0000 @@ -68,29 +68,47 @@ main(int argc, char *argv[]) { FILE *fp; - int ch; + int ch, ac; char *lp; struct sockaddr_storage ss; - int p[2], logging, secure, sval; + int p[2], logging, secure, short_list, sval; #define ENTRIES 50 char **ap, *av[ENTRIES + 1], **comp, line[1024], *prog; char rhost[MAXHOSTNAMELEN]; + ac = 2; + short_list = 0; prog = _PATH_FINGER; logging = secure = 0; openlog("fingerd", LOG_PID | LOG_CONS, LOG_DAEMON); opterr = 0; - while ((ch = getopt(argc, argv, "slp:")) != -1) + while ((ch = getopt(argc, argv, "slghmPSp:")) != -1) switch (ch) { + case 'g': + av[ac++] = "-g"; + break; + case 'h': + av[ac++] = "-h"; + break; case 'l': logging = 1; break; + case 'm': + av[ac++] = "-m"; + break; case 'p': prog = optarg; break; case 's': secure = 1; break; + case 'P': + av[ac++] = "-p"; + break; + case 'S': + short_list = 1; + av[ac++] = "-s"; + break; case '?': default: logerr("illegal option -- %c", optopt); @@ -137,11 +155,11 @@ } comp = &av[1]; - av[2] = "--"; - for (lp = line, ap = &av[3];;) { + av[ac++] = "--"; + for (lp = line, ap = &av[ac];;) { *ap = strtok(lp, " \t\r\n"); if (!*ap) { - if (secure && ap == &av[3]) { + if (secure && (strcmp("--", av[ac - 1]) == 0)) { puts("must provide username\r\n"); exit(1); } @@ -154,12 +172,17 @@ /* RFC742: "/[Ww]" == "-l" */ if ((*ap)[0] == '/' && ((*ap)[1] == 'W' || (*ap)[1] == 'w')) { - av[1] = "-l"; - comp = &av[0]; + if (!short_list) { + av[1] = "-l"; + comp = &av[0]; + } } - else if (++ap == av + ENTRIES) { - *ap = NULL; - break; + else { + ac++; + if (++ap == av + ENTRIES) { + *ap = NULL; + break; + } } lp = NULL; }