priv_add.3 (2010 09)

p
priv_add(3) priv_add(3)
NAME
priv_add: priv_add_effective(), priv_get(), priv_remove(), priv_set_effective(), privset_add_effective(),
privset_get(), privset_remove(), privset_set_effective() - add, set, remove, and retrieve a process’ privileges
SYNOPSIS
#include <sys/types.h>
#include <sys/privileges.h>
int priv_add_effective(const char *
priv_list , const char *delim);
int priv_remove(int
priv_type , const char *priv_list , const char *
delim);
int priv_set_effective(const char *
priv_list , const char *delim);
int privset_add_effective(const priv_set_t *
priv_set );
int privset_remove(int
priv_type , const priv_set_t *
priv_set );
priv_set_t *privset_get(int
priv_type , int pid);,
char *priv_get(int
priv_type , int pid);,
int privset_set_effective(const priv_set_t *
priv_set );
Parameters
delim Null-terminated string specifying the delimeter string that separates privilege names.
pid Process ID of the target process whose privileges are to be retrieved.
priv_list Sequence of privilege names in ASCII, separated by one more characters from delim
parameter.
priv_set Set of privileges in internal format.
priv_type Privilege set to be operated upon.
The following are the valid values for priv_type argument:
PRIV_EFFECTIVE
Modifies or retrieves privileges from the effective privilege set of the process.
PRIV_PERMITTED
Modifies or retrieves privileges from the permitted privilege set of the process. Note
that the privileges removed from the permitted set are also removed from the
effective and retained privilege sets.
PRIV_RETAINED
Modifies or retrieves privileges from the retained privilege set of the process.
In addition to the above values, the
privset_get()
and priv_get() routines honor
the following values for priv_type argument:
PRIV_SAVED|PRIV_EFFECTIVE
Retrieves the effective privileges of the process just before the last successful exec
family call.
PRIV_SAVED|PRIV_PERMITTED
Retrieves the permitted privileges of the process just before the last successful exec
family call.
PRIV_SAVED|PRIV_RETAINED
Retrieves the retained privileges of the process just before the last successful exec
family call.
DESCRIPTION
The
priv_add_effective(), privset_add_effective(), priv_remove(),
privset_remove(), privset_set_effective(), privset_get() and priv_get() functions
facilitate the manipulation of the privileges of a process. See privileges (5). The functions beginning with
privset_ accept an internal format of the privileges, while functions beginning with priv_ accept a
string representation of the privileges.
priv_add_effective()
Adds the given privilege(s) to the calling process effective privilege set. To add a privilege to
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (4 pages)