FADFIXPERMS(1) General Commands Manual FADFIXPERMS(1)
NAME
fadfixperms - fix the permissions of a set of files
SYNOPSIS
fadfixperms [ -V | --version ] [ -v | --verbose | -d level | --de-
bug=level ] [ -h | --help ] [ -p | --paths ] [ -n | --simulate ] [ -n |
--simulate ] perm-file filelist-file
DESCRIPTION
Fadfixperms sets the permission of list of files and directories read
from filelist-file according to the rules specified in perm-file.
CONFIGURATION
The file specified by perm-file consists of blank and hash-led lines,
which are ignored and permission specifiers. The permission specifiers
are of the form:
permission owner group pattern
Files and directories which match pattern (according to perlre(1)) will
have their owner and group changed to owner and group, and their per-
missions changed according to permission. In turn, permission is a se-
quence of nine characters representing the read, write and execute per-
missions for the file's owner and the file's group (giving nine charac-
ters for all combinations, just as is displayed by ls(1) with the -l
option). The characters may be:
r the individual read permission addressed by the position of
this character (position 1 for the owner, position 4 for the
group, position 7 for others) will be set on.
w the individual write permission addressed by the position of
this character (position 2 for the owner, position 5 for the
group, position 8 for others) will be set on.
x, s, t, S, T
the individual execute permission addressed by the position
of this character (position 3 for the owner, position 6 for
the group, position 9 for others) will be set on.
- the individual permission addressed by the position of this
character will not be set.
c the individual permission addressed by the position of this
character will be copied from the corresponding permission
for the owner of the file. This character is only valid in
positions for the group (positions 4-6) and others (positions
7-9)
! the individual permission addressed by the position of this
character will not be changed from its current value.
owner and group may be valid login or group names, or !, which means
that the owner or group will not be changed.
The first match wins.
OPTIONS
-d level, --debug=level Determines how verbose this program will be.
The message types displayed for the different
values of level are as follows: 0 displays no
messages; 1 displays only errors, 2 displays
errors and warnings; 3 displays errors, warn-
ings and informational messages; higher values
display errors, warnings, informational mes-
sages and various messages intended for debug-
ging. The default is 2.
-h, --help Displays a brief usage message.
-p, --paths Lists the compiled-in paths of various files
and directories that this program uses. -n,
--simulate Some external commands that this
program runs may be displayed rather than ac-
tually executed. BEWARE: different programs
implement different levels of simulation; so
this option may work perfectly; on the other
hand it may do nothing at all!
-v, --verbose Equivalent to -d 3.
-V, --version Prints the program's version number and exits.
-n, --simulate Fadfixperms displays the equivalent Unix com-
mands to make the required changes, but does
not actually change anything.
EXIT STATUS
On success fadfixperms returns zero. On failure it returns non-zero and
displays a diagnostic message.
FILES
None.
ENVIRONMENT VARIABLES
None.
EXAMPLES
With the following in /home/fbloggs/etc/fadfixperms.conf, the user Fred
Bloggs would allow other users to access his 'work' directory, while
keeping everything else private:
!!!c-cc-c ! ! .*/work(|/.*)
!!!------ ! ! .*
Alternatively, the following would keep the directory 'mail' private,
while opening everything else up:
!!!------ ! ! .*/mail(|/.*)
!!!c-cc-c ! ! .*
In both cases, the command to run to check and possibly correct the
permissions would be:
find /home/fbloggs | fadfixperms /home/fbloggs/etc/fadfixperms.conf -
CAVEATS
When a file is to be made accessible to the group or others, there is
an implied requirement to make all parent directories accessible (al-
though to a more limited extent). If there is a pattern provided which
matches any of these intermediate directories, then only execute per-
mission is granted to the group and others on the assumption that the
pattern that matches the intermediate directories will take care of
granting any other permissions. If there is no such pattern then the
group and others are granted both execute and read permissions.
Fadfixperms does not follow symlinks. If you make extensive use of sym-
links, then things can get very confusing. Fadfixperms does not at-
tempt to change the permissions of symlinks themselves.
STANDARDS
This manual page documents version 7 of fadfixperms.
SEE ALSO
ls(1), perlre(1), fad-config(1)
AUTHOR
Alexis Huxley <alexishuxley@gmail.com>
COPYRIGHT & DISTRIBUTION POLICY
Copyright (C) 2002-2024 Alexis Huxley
This program 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 program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MER-
CHANTABILITY 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, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
30 Jul 2024 FADFIXPERMS(1)