fixperm(ADM) 06 January 1993 fixperm(ADM) Name fixperm - examine, correct or initialize file permissions and ownership Syntax /etc/fixperm [ -acDfgilnOpsSvwX ] [ -d pkg ] [ -u pkg ] specfile Description fixperm is usually run by a shell script to configure a UNIX system upon installation. For each line in the specification file specfile, fixperm makes the listed pathname conform to a specification. Only the super user can invoke fixperm from the root directory (/) to update the permissions, ownership, and number of links on a file. All other users are restricted to being able to check the status of an installed package using the options -D, -f, -g, -i, and -n. 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 number 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. For example: uid root 0 An item specification consists of a package specifier, a permission spec- ification, 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 pack- age within a distribution set. A package is a set of files. After the package specifier is a permission specification. The permis- sion specification consists of a file type, followed by a numeric permis- sion specification. The file type is one of the following characters: a Archive. b Block device. c Character device. d Directory. e Empty file (create if -c option given). 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 file. For example, data files and encrypted files should be of type ``o''. x Executable. If the file type is used as an upper-case letter, then the file associ- ated 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 are in the third column separated by a slash: for exam- ple: ``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, that is, 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 other- wise noted: -a Ensures that all files specified in the list exist on the hard disk. -c Create empty files and missing directories. Also creates (or modifies) device files. -d pkg 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. -D List directories only on standard output. Does not modify target files. -f List files only on standard output. Does not modify target 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. -i (Available from a program or shell script only.) Check only if the selected packages are installed. Return values are: 0: package completely installed 3: not found 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. -O Omit link names from lists when used with the list options; -D, - f, -l, or -w. -p Override default uid/gid found in /etc/passwd and /etc/group with the value found in the permlist. Because UNIX and XENIX have dif- ferent 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 perms list doesn't include /etc/passwd and /etc/group. -s Modify special device files in addition to the rest of the perm- list. -S Issues a complaint if files are not in x.out format. -u pkg Like -d, but processes items that are not part of the given pack- age. -v Verbose, in particular, issues a complaint if executable files are word swapped, not fixed stack, not separate ``I'' and ``D'', or not stripped. -w Lists where (what volume) the specified files or directories are located. -X Print only files and/or directories not installed. The following two lines make a distribution and invoke tar(C) to archive only the files in /etc/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 Warning fixperm must be run from the root directory (/) when updating files. If it is invoked from any other directory, incorrect results will be returned. Files /etc/fixperm fixperm executable /etc/perms/* package permission lists See also custom(ADM) Standards conformance fixperm is not part of any currently supported standard; it is an exten- sion of AT&T System V provided by The Santa Cruz Operation, Inc.