GETPRFIENT(S) UNIX System V GETPRFIENT(S)
Name
getprfient, getprfinam, setprfient, endprfient, putprfinam -
manipulate file control database entry
Syntax
#include <sys/types.h>
#include <sys/security.h>
#include <sys/audit.h>
#include <prot.h>
struct pr_file *getprfient ()
struct pr_file *getprfinam (name);
char *name;
void setprfient ();
void endprfient ();
int putprfinam (name, pr)
char *name;
struct pr_file *pr;
Description
getprfient and getprfinam each returns a pointer to an
object with the following structure containing the broken-
out fields of a line in the file control database. Only
entries in the database dealing with users are scanned.
Each line in the database contains a ``pr_file'' structure,
declared in the <prot.h> header file:
struct f_field {
char fd_name[200]; /* Holds full path name */
ushort fd_uid; /* uid of owner */
ushort fd_gid; /* gid of group */
ushort fd_mode; /* permissions */
char fd_type[2]; /* file type (one of r,b,c,d,f,s) */
off_t fd_size; /* size in bytes */
time_t fd_mtime; /* last time file noted as touched */
time_t fd_ctime; /* last time inode noted as touched */
long fd_cksum; /* checksum for file (see sum(C)) */
};
struct f_flag {
unsigned
fg_name:1, /* Is fd_name set? */
fg_uid:1, /* Is fd_uid set? */
fg_gid:1, /* Is fd_gid set? */
fg_mode:1, /* Is fd_mode set? */
fg_type:1, /* Is fd_type set? */
fg_size:1, /* Is fd_size set? */
fg_mtime:1, /* Is fd_mtime set? */
fg_ctime:1, /* Is fd_ctime set? */
fg_cksum:1, /* Is fd_cksum set? */
fg_reserved:23; /* Reserved, leave set to 0 */
};
struct pr_file {
struct f_field ufld;
struct f_flag uflg;
struct f_field sfld;
struct f_flag sflg;
};
This structure is declared in <prot.h> so it is not
necessary to redeclare it.
getprfient when first called returns a pointer to the first
user pr_file structure in the database; thereafter, it
returns a pointer to the next pr_file structure in the
database; so successive calls can be used to search the
database. getprfinam 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 setprfient has the effect of rewinding the file
control file to allow repeated searches. Endprfient may be
called to close the file control file when processing is
complete.
Putprfinam puts a new or replaced file 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 file control database. Putprfinam locks the
database for all update operations, and performs a
endprfient after the update or failed attempt.
Files
/etc/auth/files
See Also
getprpwent(S), getprtcent(S), getprcment(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
endprfient, getprfient, getprfinam, putprfinam and
setprfient are extensions of AT&T System V provided by the
Santa Cruz Operation.
(printed 6/20/89)