Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ privgrp(4) — HP-UX 7.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getprivgrp(2)

PRIVGRP(4)

NAME

privgrp − format of privileged values

SYNOPSIS

#include <sys/privgrp.h>

DESCRIPTION

Setprivgrp(2) sets a mask of privileges, and getprivgrp(2) returns an array of structures giving privileged group assignments on a per group−id basis.  Privgrp.h contains the constants and structures needed to deal with these system calls, and contains:

/*
 * Privileged group definitions --
 * the numeric values may vary between implementations.
 */
#define PRIV_RTPRIO1
#define PRIV_MLOCK2
#define PRIV_CHOWN3
#define PRIV_LOCKRDONLY4
#define PRIV_SETRUGID5
 /* Maximum number of privileged groups in system */
#define PRIV_MAXGRPS32
 /*
 * Size of the privilege mask,
 * based on largest numbered privilege
 */
#define PRIV_MASKSIZ  1
 /*
 * Structure defining the privilege mask
 */
struct privgrp_map {
    int    priv_groupno;
    unsigned int priv_mask[PRIV_MASKSIZ];
};

PRIV_RTPRIO allows access to the rtprio(2) system call.

PRIV_MLOCK allows access to the plock(2) system call.

PRIV_CHOWN allows access to the chown(2) system calls.

PRIV_LOCKRDONLY permits the use of the lockf(2) system call for setting locks on files open for reading only.

PRIV_SETRUGID permits the use of the setuid(2) and setgid(2) system calls for changing respectively the real user ID and real group ID of a process. 

Privileges are described in a multi−word mask.  The value of the #define for each privilege is interpreted as a bit index (counting from 1).  Thus a group−id may have several different privileges associated with it by having different bits or’ed into the mask. 

The system is configured with a maximum number of groups with special privileges.  PRIV_MAXGRPS defines this maximum.  Of this maximum, one is reserved for global privileges (granted to all processes), and the remainder can be assigned to actual group−ids. 

PRIV_MASKSIZ defines the size of the multi−word mask used defining privileges associated with a group−id. 

Privileges are returned to the user from the getprivgrp(2) system call in an array of structures of type struct privgrp_map.  The structure associates a multi−word mask with a group−id. 

SEE ALSO

getprivgrp(2)

Hewlett-Packard Company  —  HP-UX Release 7.0: Sept 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026