priv_raise Subroutine

Purpose

Adds the privilege to the effective privilege set of the calling process.

Library

Security Library (libc.a)

Syntax

#include <userpriv.h>
#include <sys/priv.h>

int priv_raise(int priv1, ...)

Description

The priv_raise adds each of the privileges in the comma separated privilege list to the effective privilege set of the calling process. The argument list beginning with the priv1 parameter is of the variable length and must be terminated with a negative value. The numeric values of the privileges are defined in the header file <sys/priv.h>. To set a privilege in the effective privilege set, the calling process must have the corresponding privilege enabled in its maximum and limiting privilege sets. The priv_raise subroutine does not affect the maximum privilege set, limiting privilege set, or other privileges in the effective privilege set.

The priv_lower, priv_remove, and priv_raise subroutines all call the setppriv subroutine. Thus the calling process of these subroutine is subject to all of the restrictions and privileges imposed by the use of the setppriv subroutine.

Parameters

Item Description
priv1 The privilege identified by its number defined in the <sys/priv.h> file.

Return Values

The priv_raise subroutine returns one of the following values:

Item Description
0 The subroutine completes successfully.
1 An error has occurred.

Errors

No errno value is set.