FIXPERM(ADM) UNIX System V
Name
fixperm - correct or initialize file permissions and
ownership
Syntax
/etc/fixperm [-bcfgilnpsvwDS[-dupackage]] specfile
Description
For each line in the specification file specfile, fixperm
makes the listed pathname conform to a specification.
fixperm is typically used to configure a UNIX system upon
installation. It can only be invoked by a superuser, and it
only works from the root directory. If it is invoked from
any other directory, incorrect results will be returned.
The specification file has the following format: Each non-
blank line consists of either a comment or an item
specification. A comment is any text from a pound sign
``#'' up to the end of the line. There is one item
specification per line. User and group id numbers must be
specified at the top of the specification file for each user
and group mentioned in the file. The syntax for the
definition section is simple: the first field indicates the
type of id (either uid or gid), the second contains the name
reference for the id, and the third is the corresponding
numeric id. Example:
uid root 0
An item specification consists of a package specifier, a
permission specification, owner and group specifications,
the number of links on the file, the file name, and an
optional volume number.
The package specifier is an arbitrary string which is the
name of a package within a distribution set. A package is a
set of files.
After the package specifier is a permission specification.
The permission specification consists of a file type,
followed by a numeric permission specification. The item
specification is one of the following characters:
x Executable.
a Archive.
e Empty file (create if -c option given).
b Block device.
c Character device.
d Directory.
f Text file.
p Named pipe.
o OK. It indicates to fixperm that there should be no
file type checking allowing any format or contents in
what would normally be the header section of an
executable. For example, data files and encrypted
files should be of type ``o''.
If the item specification is used as an upper-case letter,
then the file associated with it is optional, and fixperm
will not return an error message if it does not exist.
The numeric permission conforms to the scheme described in
chmod(C). The owner and group permissions are in the third
column separated by a slash: e.g.,: ``bin/bin''. The fourth
column indicates the number of links. If there are links to
the file, the next line contains the linked filename with no
other information. The fifth column is a pathname. The
pathname must be relative, i.e., not preceded by a slash
``/''. The sixth column is only used for special files,
giving the major and minor device numbers, or volume
numbers.
Options
The following options are available from the command line,
unless otherwise noted:
-c Create empty files and missing directories. Also or
creates (or modifies) device files.
-g Instructs fixperm to list devices as specified in the
permlist (similar to the -f flag, which lists files on
standard output). No changes are made as a result of
this flag.
-dpackage
Process input lines beginning with given package
specifier string (see above). For instance, -dBASE
processes only items specified as belonging to the
Basic utilities set. The default action is to process
all lines.
-upackage
Like -u, but processes items that are not part of the
given package.
-f List files only on standard output. Does not modify
target files.
-i (Available from a program or shell script only)
Check only if the selected packages are installed.
Return values are:
0: package completely installed
4: package not installed
5: package partially installed
-l List files and directories on standard output. Does
not modify target files.
-n Report errors only. Does not modify target files.
-p Override default uid/gid found in /etc/passwd and
/etc/group with the value found in the permlist.
Because UNIX and XENIX have different values for
certain uid and gids (for example, in UNIX bin=2, and
XENIX bin=3) the default value is gleaned from the
/etc/passwd and /etc/group files. This option forces
the values to be taken from the perms list. It also
generates a warning if the permlist doesn't /etc/passwd
and /etc/group.
-D List directories only on standard output. Does not
modify target files.
-v Verbose, in particular, issues a complaint if
executable files are word swapped, not fixed stack, not
separate I and D, or not stripped.
-s Modify special device files in addition to the rest of
the permlist.
-w Lists where (what volume) the specified files or
directories are located.
-S Issues a complaint if files are not in x.out format.
The following two lines make a distribution and invoke
tar(C) to archive only the files in perms.inst on
/dev/sample:
/etc/fixperm -f /etc/perms/inst > list
tar cfF /dev/sample list
This example reports BASE package errors:
/etc/fixperm -nd BASE /etc/perms/*
or
/etc/fixperm -nd BASE /etc/perms/filename
Notes
Usually fixperm is only run by a shell script at
installation.
See Also
custom(ADM)
Value Added
fixperm is an extension of AT&T System V provided by the
Santa Cruz Operation.
(printed 8/23/89) FIXPERM(ADM)