PRIV(1)

NAME
priv, privedit - run a command with privileges

SYNOPSIS
priv [ option ... ] [ command arg ... ]

priv privedit node changes

DESCRIPTION
If a command is given, priv determines from the privs(5) file the most specifically matching REQUEST for which the process has all the NEEDS and to which it has ACCESS (terminology explained in privs(5)). If a unique most specific match is found, priv asks for confirmation. Then, if the confirmation is the request is executed. Privileges and process ceiling are set according to the pertinent entry in and the current directory is set to a place with security label L_NO; see getflab(2). Thus relative pathnames won't work in the command until it executes chdir(2).

If no command is given, the contents of the privs file are printed on the standard output.

The options are

-n  Determine and report authorization and actions. Do not execute them except, if PRIVEDIT is requested, place the edited privilege file on the standard output.

-f servfile
    Use servfile instead of to use a non-standard privilege server.

One request is more specific than another if the regular language for each argument of the first request is contained in the corresponding language for the second request, and at least one containment is proper.

The standard error and standard input are used for confirmations. Both must come from the same trusted source, either a pexable stream with a stream identifier, or a pipe from a trusted process; see pex(4) and stream(4).

Privedit applies to the privs file the modifications given in the changes file. Only the part of the authorization tree rooted at the given node may be changed. The form of changes is described in privs(5). The changes are echoed and confirmation is requested. (Privedit, like any other command, is a conventional token defined by the privs file; it is not built in.)

Priv clears the environment to prevent hidden corruption by untrusted processes. For the same reason it asks confirmation of the argument list. What you see is what it will do.

The real work of priv is done by privserv(8). Priv communicates with privserv via a pipe that the latter mounts on /cs/priv.

FILES

SEE ALSO
privs(5), privserv(8), session(1)

DIAGNOSTICS
If a command is performed, priv returns the result of the last constituent action; see privs(5).

BUGS
Trailing null args are deleted.
The standard input and standard error cannot freely be redirected.
It is possible for a password to be demanded twice. This would be mitigated if requests were assessed in decreasing order of specificity instead of table order.