summaryrefslogtreecommitdiff
path: root/usr/src/man/man4/logindevperm.4
blob: 6fad0f269f3a3589c99a424d1e36056cc77fca02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH LOGINDEVPERM 4 "Sep 25, 2008"
.SH NAME
logindevperm, fbtab \- login-based device permissions
.SH SYNOPSIS
.LP
.nf
\fB/etc/logindevperm\fR
.fi

.SH DESCRIPTION
.sp
.LP
The \fB/etc/logindevperm\fR file contains information that is used by
\fBlogin\fR(1) and \fBttymon\fR(1M) to change the owner, group, and permissions
of devices upon logging into or out of a console device. By default, this file
contains lines for the keyboard, mouse, audio, and frame buffer devices.
.sp
.LP
The owner of the devices listed in \fB/etc/logindevperm\fR is set to the owner
of the console by \fBlogin\fR(1). The group of the devices is set to the
owner's group specified in \fB/etc/passwd\fR. The permissions are set as
specified in \fB/etc/logindevperm\fR.
.sp
.LP
If the console is \fB/dev/vt/active\fR, the owner of the devices is the first
user logged in on the consoles (\fB/dev/console\fR or \fB/dev/vt/#\fR). Upon
this first user's logout the owner and group of these devices is reset by
\fBttymon\fR(1M) to owner root and root's group as specified in
\fB/etc/passwd\fR.
.sp
.LP
Fields are separated by a TAB or SPACE characters. Blank lines and comments can
appear anywhere in the file; comments start with a hashmark, (\fB#\fR), and
continue to the end of the line.
.sp
.LP
The first field specifies the name of a console device (for example,
\fB/dev/console\fR). By default, it is \fB/dev/vt/active\fR, which points to
the current active console, including \fB/dev/console\fR and all virtual
consoles (\fB/dev/vt/#\fR). The second field specifies the permissions to which
the devices in the \fIdevice_list\fR field (third field) are set. These
permissions must be expressed in octal format, for example, \fB0774\fR. A
\fIdevice_list\fR is a colon-separated list of device names. A device name must
be a \fB/dev\fR link.
.sp
.LP
A directory or logical name in the device name can be either one of the
following:
.RS +4
.TP
.ie t \(bu
.el o
A fully qualified name, for example, \fBfbs\fR.
.RE
.RS +4
.TP
.ie t \(bu
.el o
A regular expression, for example, \fB[a-z0-9.]+\fR. See \fBregexp\fR(5) for
more information on regular expressions.
.RE
.RS +4
.TP
.ie t \(bu
.el o
The wildcard character \fB*\fR specifying all directory or node names (except
\fB\&.\fR and \fB\&..\fR, for example, \fB/dev/fbs/*\fR specifies all frame
buffer devices.
.RE
.sp
.LP
Some examples of \fB/etc/logindevperm\fR file entries include:
.sp
.in +2
.nf
/dev/usb/[0-9a-f]+[.][0-9a-f]+/[0-9]+/[a-z0-9.]+
/dev/usb/[0-9a-f]+[.][0-9a-f]+/[0-9]+/*
/dev/usb/[0-9a-f]+[.][0-9a-f]+/*/*
.fi
.in -2

.sp
.LP
Specify all \fBugen\fR(7D) endpoints and status nodes.
.sp
.LP
Drivers can also be specified to limit the permission changes to minor nodes
owned by the specified drivers. For example,
.sp
.in +2
.nf
/dev/console    0600    /dev/usb/[0-9a-f]+[.][0-9a-f]+/[0-9]+/* \e
driver=usb_mid,scsa2usb,usbprn  # libusb devices
.fi
.in -2

.sp
.LP
Due to the persistence of \fBdevfs\fR(7FS) minor node management, the user
should be logged in as root if the list of minor nodes will be reduced and the
devices should all be plugged in.
.sp
.LP
Once the devices are owned by the user, their permissions and ownership can be
changed using \fBchmod\fR(1) and \fBchown\fR(1), as with any other user-owned
file.
.sp
.LP
Upon logout the owner and group of these devices are reset by \fBttymon\fR(1M)
to owner \fBroot\fR and root's group as specified in \fB/etc/passwd\fR
(typically \fBother\fR). The permissions are set as specified in the
\fB/etc/logindevperm\fR file.
.SH FILES
.sp
.ne 2
.na
\fB\fB/etc/passwd\fR\fR
.ad
.RS 15n
File that contains user group information.
.RE

.SH SEE ALSO
.sp
.LP
\fBchmod\fR(1), \fBchown\fR(1), \fBlogin\fR(1), \fBttymon\fR(1M),
\fBpasswd\fR(4), \fBregexp\fR(5), \fBugen\fR(7D)
.SH NOTES
.sp
.LP
\fB/etc/logindevperm\fR provides a superset of the functionality provided by
\fB/etc/fbtab\fR in SunOS 4.\fIx\fR releases.