GETPRCMENT(S) UNIX System V GETPRCMENT(S)
Name
getprcment, getprcmnam, setprcment, endprcment, putprcmnam -
manipulate command control database entry
Syntax
#include <sys/types.h>
#include <sys/security.h>
#include <sys/audit.h>
#include <prot.h>
struct pr_command *getprcment ()
struct pr_command *getprcmnam (name);
char *name;
void setprcment ();
void endprcment ();
int putprcmnam (name, pr)
char *name;
struct pr_command *pr;
Description
Getprcment and getprcmnam each returns a pointer to an
object with the following structure containing the broken-
out fields of a line in the command control database. Only
entries in the database dealing with users are scanned.
Each line in the database contains a ``pr_command''
structure, declared in the <prot.h> header file:
struct c_field {
char fd_name[15]; /* holds command name */
char fd_path[200];/* xref to File Control Database */
ushort fd_uid; /* uid of owner */
ushort fd_gid; /* gid of group */
};
struct c_flag {
unsigned
fg_name:1, /* Is fd_name set? */
fg_path:1, /* Is fd_path set? */
fg_uid:1, /* Is fd_uid set? */
fg_gid:1, /* Is fd_gid set? */
fg_reserved:28; /* Reserved, leave set to 0 */
};
struct pr_command {
struct c_field ufld;
struct c_flag uflg;
struct c_field sfld;
struct c_flag sflg;
};
This structure is declared in <prot.h> so it is not
necessary to redeclare it.
Getprcment when first called returns a pointer to the first
user pr_command structure in the database; thereafter, it
returns a pointer to the next pr_command structure in the
database; so successive calls can be used to search the
database. Getprcmnam searches from the beginning of the
file until a login name matching name is found, and returns
a pointer to the particular structure in which it was found.
If an end-of-file or an error is encountered on reading,
these functions return a NULL pointer.
A call to setprcment has the effect of rewinding the command
control file to allow repeated searches. Endprcment may be
called to close the command control file when processing is
complete.
Putprcmnam puts a new or replaced command control entry pr
with key name into the appropriate file(s). If the
"uflg.fg_name" field is 0, the requested entry is deleted
from the command control database. Putprcmnam locks the
database for all update operations, and performs a
endprcment after the update or failed attempt.
Files
/etc/auth/commands
See Also
getprpwent(S), getprtcent(S), getprfient(S), getprdfent(S),
authcap(S), authcap(F)
Diagnostics
A NULL pointer is returned on EOF or error.
Notes
All information is contained in a static area, so it must be
copied if it is to be saved.
Value Added
endprcment, getprcment, getprcmnam, putprcmnam and
setprcment are extensions of AT&T System V provided by the
Santa Cruz Operation.
(printed 6/20/89)