summaryrefslogtreecommitdiffstats
path: root/man/dpkg-statoverride.pod
blob: 5220c47ece65000f4a613e26c1808a33f19d3738 (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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# dpkg manual page - dpkg-statoverride(1)
#
# Copyright © 2000-2001 Wichert Akkerman <wakkerma@debian.org>
# Copyright © 2009-2011, 2013, 2015 Guillem Jover <guillem@debian.org>
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

=encoding utf8

=head1 NAME

dpkg-statoverride - override ownership and mode of files

=head1 SYNOPSIS

B<dpkg-statoverride>
[I<option>...] I<command>

=head1 DESCRIPTION

“B<stat overrides>” are a way to tell
L<dpkg(1)>
to use a different owner
or mode for a path when a package is installed (this applies to any
filesystem object that
B<dpkg>
handles, including directories, devices, etc.).
This can be used to
force programs that are normally setuid to be install without a setuid
flag, or only executable by a certain group.

B<dpkg-statoverride> is a utility to manage the list of stat
overrides.
It has three basic functions: adding, removing and listing
overrides.

=head1 COMMANDS

=over

=item B<--add> I<user group mode path>

Add an override for I<path>.
I<path> does not need to exist nor be known to
B<dpkg> when this command is used; the override will be stored and used later.
Users and groups can be specified by their name (for example B<root>
or B<nobody>), or by their number by prepending the number with a
‘B<#>’ (for example B<#0> or B<#65534>).
The I<mode> needs to be specified in octal.

If B<--update> is specified and I<path> exists, it is immediately
set to the new owner and mode.

=item B<--remove> I<path>

Remove an override for I<path>, the status of I<path> is left
unchanged by this command.

=item B<--list> [I<glob-pattern>]

List all overrides.
If a glob pattern is specified restrict the output
to overrides which match the glob.

=item B<--help>

Show the usage message and exit.

=item B<--force-help>

Give help about the B<--force->I<thing> options (since dpkg 1.19.5).

=item B<--version>

Show the version and exit.

=back

=head1 OPTIONS

=over

=item B<--admindir> I<directory>

Set the administrative directory to I<directory>.
This is where the I<statoverride> file is stored.
Defaults to «I<%ADMINDIR%>» if B<DPKG_ADMINDIR> has not been set.

=item B<--instdir> I<directory>

Set the installation directory, which refers to the directory where
packages get installed (since dpkg 1.19.2).
Defaults to «I</>» if B<DPKG_ROOT> has not been set.

=item B<--root> I<directory>

Set the root directory to B<directory>, which sets the installation
directory to «I<directory>» and the administrative
directory to «I<directory>B<%ADMINDIR%>» (since dpkg 1.19.2)
if B<DPKG_ROOT> has not been set.

=item B<--force->I<things>

=item B<--no-force->I<things>, B<--refuse->I<things>

Force or refuse (B<no-force> and B<refuse> mean the same thing)
to do some things (since dpkg 1.19.5).
I<things> is a comma separated list of things specified below.
B<--force-help> displays a message describing them.
Things marked with (*) are forced by default.

B<Warning>: These options are mostly intended to be used by experts only.
Using them without fully understanding their effects may break your whole
system.

=over 4

=item B<all>:

Turns on (or off) all force options.

=item B<statoverride-add>:

Overwrite an existing stat override when adding it (since dpkg 1.19.5).

=item B<statoverride-remove>:

Ignore a missing stat override when removing it (since dpkg 1.19.5).

=item B<security-mac>(*):

Use platform-specific Mandatory Access Controls (MAC) based security when
installing files into the filesystem (since dpkg 1.19.5).
On Linux systems the implementation uses SELinux.

=item B<not-root>:

Try to (de)install things even when not root (since dpkg 1.21.8).

=back

=item B<--force>

Force an action, even if a sanity check would otherwise prohibit it.
This is necessary to override an existing override.
This option is deprecated (since dpkg 1.19.5), it is replaced by
B<--force-all>.

=item B<--update>

Immediately try to change the I<path> to the new owner and mode if it
exists.

=item B<--quiet>

Be less verbose about what we do.

=back

=head1 EXIT STATUS

=over

=item B<0>

The requested action was successfully performed.

=item B<1>

For B<--list>, if there are no overrides or none match the supplied
glob.

=item B<2>

Fatal or unrecoverable error due to invalid command-line usage, or
interactions with the system, such as accesses to the database,
memory allocations, etc.

=back

=head1 ENVIRONMENT

=over

=item B<DPKG_ROOT>

If set and the B<--instdir> or B<--root> options have not been
specified, it will be used as the filesystem root directory
(since dpkg 1.19.2).

=item B<DPKG_ADMINDIR>

If set and the B<--admindir> or B<--root> options have not been
specified, it will be used as the B<dpkg> data directory.

=item B<DPKG_DEBUG>

Sets the debug mask (since dpkg 1.21.10) from an octal value.
The currently accepted flags are described in the B<dpkg --debug> option,
but not all these flags might have an effect on this program.

=item B<DPKG_FORCE>

If set and none of the B<--force->I<...> options have been
specified, it will be used as the force options to use (since dpkg 1.19.5).

=item B<DPKG_COLORS>

Sets the color mode (since dpkg 1.18.5).
The currently accepted values are: B<auto> (default), B<always> and
B<never>.

=back

=head1 FILES

=over

=item I<%ADMINDIR%/statoverride>

File which contains the current list of stat overrides of the system.
It
is located in the B<dpkg> administration directory, along with other files
important to B<dpkg>, such as I<status> or I<available>.

B<Note>: B<dpkg-statoverride> preserves the old copy of this file, with
extension “-old”, before replacing it with the new one.

=back

=head1 SEE ALSO

L<dpkg(1)>.