BSD 4_3_Reno release
[unix-history] / usr / src / usr.bin / uucp / USERFILE.5
CommitLineData
55331617
KM
1.\" Copyright (c) 1986 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
1c15e888 5.\" @(#)USERFILE.5 6.2 (Berkeley) 6/23/90
55331617 6.\"
1c15e888 7.TH USERFILE 5 "June 23, 1990"
55331617
KM
8.UC 6
9.SH NAME
10USERFILE \- \s-1UUCP\s0 pathname permissions file
11.SH DESCRIPTION
12The
13.I USERFILE
14file specifies the file system directory trees that are accessible to
15local users and to remote systems via \s-1UUCP\s0.
16.PP
17Each line in
18.I USERFILE
19is of the form:
20.PP
21[\fIloginname\fP]\fB,\fP[\fIsystem\fP] [ \fBc\fP ] \fIpathname\fP \c
22[\fIpathname\fP] [\fIpathname\fP]
23.PP
24The first two items are separated by a comma; any number of spaces or
25tabs may separate the remaining items.
26Lines beginning with a `#' character are comments.
27A trailing `\e' indicates that the next line
28is a continuation of the current line.
29.PP
30.I Loginname
31is a login (from
32.IR /etc/passwd )
33on the local machine.
34.PP
35.I System
36is the name of a remote machine, the same name used in
37.IR L.sys (5).
38.PP
39.I c
40denotes the optional
41.I callback
42field.
43If a \fBc\fP appears here, a remote machine that calls in will be told
44that callback is requested, and the conversation will be terminated.
45The local system will then immediately call the remote host back.
46.PP
47.I Pathname
48is a pathname prefix that is permissible for this
49.I login
50and/or
51.IR system .
52.PP
53When
54.IR uucico (8C)
55runs in master role or
56.IR uucp (1C)
57or
58.IR uux (1C)
59are run by local users, the permitted pathnames are those on the
60first line with a
61.I loginname
62that matches the name of the user who executed the command.
63If no such line exists, then the first line with a null (missing)
64.I loginname
65field is used.
66(Beware:
67.I uucico
68is often run by the superuser or the \s-1UUCP\s0 administrator through
69.IR cron (8).)
70.PP
71When
72.I uucico
73runs in slave role, the permitted pathnames are those on the
74first line with a
75.I system
76field that matches the hostname of the remote machine.
77If no such line exists, then the first line with a null (missing)
78.I system
79field is used.
80.PP
81.IR Uuxqt (8)
82works differently; it knows neither a login name nor a hostname.
83It accepts the pathnames on the first line that has a null
84.I system
85field.
86(This is the same line that is used by
87.I uucico
88when it cannot match the remote machine's hostname.)
89.PP
90A line with both
91.I loginname
92and
93.I system
94null, for example
95.IP
dde9b027 96.B , /var/spool/uucppublic
55331617
KM
97.PP
98can be used to conveniently specify the paths for both "no match" cases
99if lines earlier in
100.I USERFILE
101did not define them.
102(This differs from older Berkeley and all USG versions, where each case
103must be individually specified.
104If neither case is defined earlier,
105a "null" line only defines the "unknown login" case.)
106.PP
107To correctly process
108.I loginname
109on systems that assign several logins per UID,
110the following strategy is used to determine the current
111.IR loginname :
112.TP
1131)
114If the process is attached to a terminal, a login entry exists in
dde9b027 115.IR /var/run/utmp ,
55331617
KM
116and the UID for the
117.I utmp
118name matches the current real UID, then
119.IR loginname
120is set to the
121.I utmp
122name.
123.TP
1242)
125If the
126.B USER
127environment variable is defined and the UID for this name matches
128the current real UID, then
129.IR loginname
130is set to the name in
131.BR USER .
132.TP
1333)
134If both of the above fail, call
135.IR getpwuid (3)
136to fetch the first name in
137.I /etc/passwd
138that matches the real UID.
139.TP
1404)
141If all of the above fail, the utility aborts.
142.SH FILES
143.ta \w'/usr/lib/uucp/UUAIDS/USERFILE 'u
144.nf
145/usr/lib/uucp/USERFILE
146/usr/lib/uucp/UUAIDS/USERFILE USERFILE example
147.fi
148.SH SEE ALSO
149uucp(1C), uux(1C), L.cmds(5), L.sys(5), uucico(8C), uuxqt(8C)
150.SH NOTES
151The \s-1UUCP\s0 utilities
152.RI ( uucico ,
153.IR uucp ,
154.IR uux ,
155and
156.IR uuxqt )
157always have access to the \s-1UUCP\s0 spool files in
dde9b027 158.IR /var/spool/uucp ,
55331617
KM
159regardless of pathnames in
160.IR USERFILE .
161.PP
162If
163.B uucp
164is listed in
165.IR L.cmds (5),
166then a remote system will execute
167.I uucp
168on the local system with the
169.I USERFILE
170privileges for its
171.IR login ,
172not its hostname.
173.PP
174.I Uucico
175freely switches between master and slave roles during the course of a
176conversation, regardless of the role it was started with.
177This affects how
178.I USERFILE
179is interpreted.
180.SH WARNING
181.I USERFILE
182restricts access only on strings that the \s-1UUCP\s0 utilities identify
183as being pathnames.
184If the wrong holes are left in other \s-1UUCP\s0 control files (notably
185.IR L.cmds ),
186it can be easy for an intruder to open files anywhere in the file system.
187Arguments to
188.IR uucp (1C)
189are safe, since it assumes all of its non-option arguments are files.
190.IR Uux (1C)
191cannot make such assumptions; hence, it is more dangerous.
192.SH BUGS
193The
194.I "\s-1UUCP\s0 Implementation Description"
195explicitly states that all remote login names must be listed in
196.IR USERFILE .
197This requirement is not enforced by Berkeley \s-1UUCP\s0, although it is
198by USG \s-1UUCP\s0.
199.PP
200Early versions of 4.2BSD
201.IR uuxqt (8)
202erroneously check \s-1UUCP\s0 spool files against the
203.I USERFILE
204pathname permissions.
205Hence, on these systems it is necessary to specify
dde9b027 206.I /var/spool/uucp
55331617
KM
207as a valid path on the
208.I USERFILE
209line used by
210.IR uuxqt .
211Otherwise, all
212.IR uux (1C)
213requests are rejected with a "PERMISSION DENIED" message.