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