procprivl(3C)


procprivl -- add, remove, count, or put privileges associated with the calling process

Synopsis

   #include	<priv.h>
   

int procprivl(int cmd, priv_t priv1, . . .);

Description

The procprivl function is used to add, remove, count, or put the privileges associated with the calling process. privN is a list of privilege descriptors, each of which contains the privilege set and identity of the requested privilege. The list is terminated with a (priv_t)0 value.

The recognized cmds and their functions are described below:


SETPRV
the working privilege set for the current process is set based on the privilege descriptor(s) contained in privN. All requested privileges not contained in the current maximum privilege set are ignored. All requested working privileges that are in the current maximum set are added to the working set. If any argument is invalid, none of the process privileges is changed.

CLRPRV
the working and maximum privilege sets for the current process are cleared based on the privilege descriptor(s) contained in privN. All requested privileges are removed from their respective sets. The working set is adjusted to be a subset of the resulting maximum set. If any argument is invalid, none of the process privileges is changed.

PUTPRV
the working and maximum privilege sets for the current process are set based on the privilege descriptor(s) contained in privN. The setting is absolute. The working set is adjusted to be a subset of the resulting maximum set. Privileges contained in either privilege set that are not in the maximum set of the calling process are ignored. If any argument is invalid, none of the process privileges is changed.

CNTPRV
returns the number of privileges associated with the current process. The privN arguments are ignored. None of the process privileges is changed.

Return values

A value of -1 is returned and errno is set to indicate the error if procprivl is unsuccessful. If successful, procprivl returns the number of privileges associated with the current process (SETPRV, CLRPRV, and PUTPRV or CNTPRV).

Errors

procprivl fails if the following is true:


EINVAL
cmd or privilege specified is invalid.

References

intro(2), filepriv(2), procpriv(2), priv(5), privilege(5)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004