HP-UX Reference (11i v2 07/12) - 3 Library Functions N-Z (vol 7)

p
priv_add(3) priv_add(3)
NAME
priv_add: priv_add_effective(), 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);,
int privset_set_effective(const priv_set_t *
priv_set);
Parameters
delim Null-terminated string specifying the delimiter 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.
DESCRIPTION
The priv_add_effective(), privset_add_effective()
, priv_remove() ,
privset_remove(), privset_set_effective()
, and privset_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 the
effective privilege set, the privilege should be present in the permitted privilege set of the calling
process.
priv_remove()
Removes the given privilege(s) from the calling process’ privilege set. The priv_type argument
specifies the privilege set is to be modified. Privileges removed from permitted privilege set are
also removed from effective and retained privilege sets of the calling process.
HP-UX 11i Version 2: December 2007 Update − 1 − Hewlett-Packard Company 163