| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 2: System Calls Oracle Solaris 11 Information Library |
- get or set a privilege set
#include <priv.h>intgetppriv(priv_ptype_twhich,priv_set_t *set);
intsetppriv(priv_op_top,priv_ptype_twhich,priv_set_t *set);
Thegetppriv() function returns the process privilege set specified bywhich inthe set pointed to byset. The memory forset must firstbe allocated withpriv_allocset() and later freed withpriv_freeset(). Both functions are documentedon thepriv_addset(3C) manual page.
Thesetppriv() function sets or changes the process privilege set. Theopargument specifies the operation and can be one ofPRIV_OFF,PRIV_ON orPRIV_SET. Thewhich argument specifies the name of the privilege set. Thesetargument specifies the set.
Ifop isPRIV_OFF, the privileges inset are removed from theprocess privilege set specified bywhich. There are no restrictions on removingprivileges from process privileges sets, but the following apply:
Privileges removed fromPRIV_PERMITTED are silently removed fromPRIV_EFFECTIVE.
If privileges are removed fromPRIV_LIMIT, they are not removed from the other sets until one ofexec(2) functions has successfully completed.
Ifop isPRIV_ON, the privileges inset are added to theprocess privilege set specified bywhich. The following operations are permitted:
Privileges inPRIV_PERMITTED can be added toPRIV_EFFECTIVE without restriction.
Privileges inPRIV_PERMITTED can be added toPRIV_INHERITABLE without restriction.
All operations that attempt to add privileges that are already present are permitted.
Ifop isPRIV_SET, the privileges inset replace completely the processprivilege set specified bywhich.PRIV_SET is implemented in terms ofPRIV_OFFandPRIV_ON. The same restrictions apply.
Upon successful completion, 0 is returned. Otherwise, -1 is returned anderrno is set to indicate the error.
Thegetppriv() andsetppriv() functions will fail if:
The value ofop orwhich is out of range.
Theset argument points to an illegal address.
Thesetppriv() function will fail if:
The application attempted to add privileges toPRIV_LIMIT orPRIV_PERMITTED, or the application attempted to add privileges toPRIV_INHERITABLE orPRIV_EFFECTIVE which were not inPRIV_PERMITTED.
Seeattributes(5) for descriptions of the following attributes:
|
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |