Content-type: text/html
getesdfent, getesdfnam, setprdfent, endprdfent, putesdfnam - Manipulate system default database entry (Enhanced Security)
Security Library (libsecurity.so)
NOTE: In order to quickstart a program, the program must be linked as follows:
See the shared library discussion in the Programmer's Guide for more information about using the quickstarting feature.
#include <sys/types.h>
#include <sys/security.h>
#include <prot.h>
struct es_default *getesdfent(void);
struct es_default *getesdfnam(
char *name);
void setprdfent(void);
void endprdfent(void);
int putesdfnam(
char *name,
struct es_default *pr);
Specifies a system default database entry name. Specifies a system default database control entry structure.
The
getesdfent()
and
getesdfnam()
functions
each return a pointer to
an object with the following structure containing the
separated-out fields of a line in the system default database.
Each line in the database contains a es_default structure, declared
in the
<prot.h>
file as follows:
struct es_default {
AUTH_ESCAP_COMMON
char *dd_name; /* copy of sfld->fd_name */
int dg_name; /* copy of sflg->fg_name */
size_t esprof_flen;
struct espw_field *prd;
struct espw_flag *prg;
size_t estc_flen;
struct estc_field *tcd;
struct estc_flag *tcg;
size_t esdev_flen;
struct esdev_field *devd;
struct esdev_flag *devg;
size_t fieldlen;
struct es_default_fields *sfld;
struct es_default_flags *sflg;
} ;
struct system_default_fields
{
time_t fd_inactivity_timeout;
time_t fd_pw_expire_warning;
char fd_pw_site_callout[MAXPATHLEN];
mask_t fd_secclass[AUTH_SECCLASSVEC_SIZE];
/* System security class */
char fd_boot_authenticate;
char fd_audit_enable;
} ;
struct system_default_flags
{
unsigned int
fg_inactivity_timeout : 1,
fg_pw_expire_warning : 1,
fg_pw_site_callout : 1,
fg_boot_authenticate : 1,
fg_audit_enable : 1,
fg_secclass : 1 ;
} ;
struct es_default_fields
{
char *fd_name;
time_t fd_inactivity_timeout;
time_t fd_pw_expire_warning;
char *fd_pw_site_callout;
mand_ir_t *fd_single_user_sl;
mask_t *fd_secclass; /* System security class */
char fd_boot_authenticate;
char fd_audit_enable;
char fd_preexpire; /* admin-set psw should be expired */
char fd_skip_ttys_update; /* skip putprtcnam in login path */
char fd_auto_migrate_u; /* auto-create 'missing' profiles */
time_t fd_max_vac_future; /* how far into future can vac. be? */
time_t fd_max_vac_len; /* how long can vac. be (by user)? */
/* if either of the above fields is 0, user-originated 'vacation'
* scheduling is disabled. */
char fd_accept_vouch; /* accept 'vouching' in SIA */
} ;
struct es_default_flags
{
unsigned int
fg_name : 1,
fg_inactivity_timeout : 1,
fg_pw_expire_warning : 1,
fg_pw_site_callout : 1,
fg_single_user_sl : 1, /* sens. level for single-user*/
fg_boot_authenticate : 1,
fg_audit_enable : 1,
fg_secclass : 1,
fg_preexpire : 1, /* Is fd_preexpire set? */
fg_skip_ttys_update : 1, /* Have fd_skip_ttys_update? */
fg_auto_migrate_u : 1, /* Have fd_auto_migrate_u? */
fg_max_vac_future : 1, /* Have fd_max_vac_future? */
fg_max_vac_len : 1, /* Have fd_max_vac_len? */
fg_accept_vouch : 1 /* Have fd_accept_vouch? */
;
} ;
Currently there is only one entry in the system default database, referenced by the name "default".
The system default database contains default values for all parameters in the protected password, terminal control, and device assignment databases, as well as configurable system-wide parameters. The fields from the other databases are described in the corresponding reference pages.
The getesdfent() function returns a pointer to the first es_default structure in the database when first called. Thereafter, it returns a pointer to the next es_default structure in the database, so successive calls can be used to search the database (not currently supported). The getesdfnam() function searches from the beginning of the file until a default entry 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. Currently, all programs access the default database by calling getesdfnam() (the default).
A call to the setprdfent() function has the effect of rewinding the default control file to allow repeated searches. The endprdfent() function can be called to close the database when processing is complete.
The putesdfnam() function puts a new or replaced default control entry pr with key name into the database. If the sflg->fg_name field contains a value of 0 (zero), the requested entry is deleted from the system default database. The putesdfnam() function locks the database for all update operations, and performs an endprdfent() after the update or failed attempt.
Structures returned by the database routines contain pointers to character strings and lists rather than being self-contained. The copy functions must be used rather than doing a structure assignment to save a returned structure.
Do not delete the system default entry. This renders the system unusable.
The getesdfent() and getesdfnam() functions return null pointers on EOF or an error. The putesdfnam() function returns a value of 0 (zero) if it cannot add or update the entry.
Functions: getespwent(3), getestcent(3), getesdvent(3)
Security delim off