View | Details | Raw Unified | Return to bug 39463
Collapse All | Expand All

(-)libexec/fingerd/fingerd.8 (-5 / +41 lines)
Lines 32-38 Link Here
32
.\"     @(#)fingerd.8	8.1 (Berkeley) 6/4/93
32
.\"     @(#)fingerd.8	8.1 (Berkeley) 6/4/93
33
.\" $FreeBSD: src/libexec/fingerd/fingerd.8,v 1.8 2001/08/10 13:45:21 ru Exp $
33
.\" $FreeBSD: src/libexec/fingerd/fingerd.8,v 1.8 2001/08/10 13:45:21 ru Exp $
34
.\"
34
.\"
35
.Dd June 4, 1993
35
.Dd June 18, 2002
36
.Dt FINGERD 8
36
.Dt FINGERD 8
37
.Os
37
.Os
38
.Sh NAME
38
.Sh NAME
Lines 42-47 Link Here
42
.Nm
42
.Nm
43
.Op Fl s
43
.Op Fl s
44
.Op Fl l
44
.Op Fl l
45
.Op Fl h
46
.Op Fl m
47
.Op Fl P
48
.Op Fl S
49
.Op Fl g
45
.Op Fl p Ar filename
50
.Op Fl p Ar filename
46
.Sh DESCRIPTION
51
.Sh DESCRIPTION
47
.Nm Fingerd
52
.Nm Fingerd
Lines 97-111 Link Here
97
as server program arguments in
102
as server program arguments in
98
.Pa /etc/inetd.conf :
103
.Pa /etc/inetd.conf :
99
.Bl -tag -width indent
104
.Bl -tag -width indent
100
.It Fl s
105
.It Fl g
101
Enable secure mode.
106
Do not show any gecos information besides the users' real names. When
102
Queries without a user name are rejected and
107
used in conjunction with the
103
forwarding of queries to other remote hosts is denied.
108
.Fl h
109
option, it also has the side-effect of restricting output of the
110
host name from which the user is connected.
111
.It Fl h
112
Display the name of the remote host in short mode,
113
instead of the office location and office phone.
104
.It Fl l
114
.It Fl l
105
Enable logging.
115
Enable logging.
106
The name of the host originating the query is reported via
116
The name of the host originating the query is reported via
107
.Xr syslog 3
117
.Xr syslog 3
108
at LOG_NOTICE priority.
118
at LOG_NOTICE priority.
119
.It Fl m
120
Prevent matching of
121
.Ar user
122
names.
123
.Ar User
124
is usually a login name; however, matching will also be done on the
125
users' real names, unless this option is supplied.
109
.It Fl p
126
.It Fl p
110
Use an alternate program as the local information provider.
127
Use an alternate program as the local information provider.
111
The default local program
128
The default local program
Lines 117-122 Link Here
117
this option allows a system manager
134
this option allows a system manager
118
to have more control over what information is
135
to have more control over what information is
119
provided to remote sites.
136
provided to remote sites.
137
.It Fl s
138
Enable secure mode.
139
Queries without a user name are rejected and
140
forwarding of queries to other remote hosts is denied.
141
.It Fl P
142
Prevents
143
.Xr finger 1
144
from displaying the contents of the
145
.Dq Pa .plan ,
146
.Dq Pa .project ,
147
.Dq Pa .pubkey 
148
and
149
.Dq Pa .forward
150
files.
151
.It Fl S
152
Prints user information in short mode, one line per user.
153
This overrides the
154
.Dq Pa Whois switch
155
that may be passed in from the remote client.
120
.El
156
.El
121
.Sh SEE ALSO
157
.Sh SEE ALSO
122
.Xr finger 1 ,
158
.Xr finger 1 ,
(-)libexec/fingerd/fingerd.c (-11 / +34 lines)
Lines 68-96 Link Here
68
main(int argc, char *argv[])
68
main(int argc, char *argv[])
69
{
69
{
70
	FILE *fp;
70
	FILE *fp;
71
	int ch;
71
	int ch, ac;
72
	char *lp;
72
	char *lp;
73
	struct sockaddr_storage ss;
73
	struct sockaddr_storage ss;
74
	int p[2], logging, secure, sval;
74
	int p[2], logging, secure, short_list, sval;
75
#define	ENTRIES	50
75
#define	ENTRIES	50
76
	char **ap, *av[ENTRIES + 1], **comp, line[1024], *prog;
76
	char **ap, *av[ENTRIES + 1], **comp, line[1024], *prog;
77
	char rhost[MAXHOSTNAMELEN];
77
	char rhost[MAXHOSTNAMELEN];
78
78
79
	ac = 2;
80
	short_list = 0;
79
	prog = _PATH_FINGER;
81
	prog = _PATH_FINGER;
80
	logging = secure = 0;
82
	logging = secure = 0;
81
	openlog("fingerd", LOG_PID | LOG_CONS, LOG_DAEMON);
83
	openlog("fingerd", LOG_PID | LOG_CONS, LOG_DAEMON);
82
	opterr = 0;
84
	opterr = 0;
83
	while ((ch = getopt(argc, argv, "slp:")) != -1)
85
	while ((ch = getopt(argc, argv, "slghmPSp:")) != -1)
84
		switch (ch) {
86
		switch (ch) {
87
		case 'g':
88
			av[ac++] = "-g";
89
			break;
90
		case 'h':
91
			av[ac++] = "-h";
92
			break;
85
		case 'l':
93
		case 'l':
86
			logging = 1;
94
			logging = 1;
87
			break;
95
			break;
96
		case 'm':
97
			av[ac++] = "-m";
98
			break;
88
		case 'p':
99
		case 'p':
89
			prog = optarg;
100
			prog = optarg;
90
			break;
101
			break;
91
		case 's':
102
		case 's':
92
			secure = 1;
103
			secure = 1;
93
			break;
104
			break;
105
		case 'P':
106
			av[ac++] = "-p";
107
			break;
108
		case 'S':
109
			short_list = 1;
110
			av[ac++] = "-s";
111
			break;
94
		case '?':
112
		case '?':
95
		default:
113
		default:
96
			logerr("illegal option -- %c", optopt);
114
			logerr("illegal option -- %c", optopt);
Lines 137-147 Link Here
137
	}
155
	}
138
156
139
	comp = &av[1];
157
	comp = &av[1];
140
	av[2] = "--";
158
	av[ac++] = "--";
141
	for (lp = line, ap = &av[3];;) {
159
	for (lp = line, ap = &av[ac];;) {
142
		*ap = strtok(lp, " \t\r\n");
160
		*ap = strtok(lp, " \t\r\n");
143
		if (!*ap) {
161
		if (!*ap) {
144
			if (secure && ap == &av[3]) {
162
			if (secure && (strcmp("--", av[ac - 1]) == 0)) {
145
				puts("must provide username\r\n");
163
				puts("must provide username\r\n");
146
				exit(1);
164
				exit(1);
147
			}
165
			}
Lines 154-165 Link Here
154
172
155
		/* RFC742: "/[Ww]" == "-l" */
173
		/* RFC742: "/[Ww]" == "-l" */
156
		if ((*ap)[0] == '/' && ((*ap)[1] == 'W' || (*ap)[1] == 'w')) {
174
		if ((*ap)[0] == '/' && ((*ap)[1] == 'W' || (*ap)[1] == 'w')) {
157
			av[1] = "-l";
175
			if (!short_list) {
158
			comp = &av[0];
176
				av[1] = "-l";
177
				comp = &av[0];
178
			}
159
		}
179
		}
160
		else if (++ap == av + ENTRIES) {
180
		else {
161
			*ap = NULL;
181
			ac++;
162
			break;
182
			if (++ap == av + ENTRIES) {
183
				*ap = NULL;
184
				break;
185
			}
163
		}
186
		}
164
		lp = NULL;
187
		lp = NULL;
165
	}
188
	}

Return to bug 39463