DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

ia_uinfo(3iac)


ia_uinfo: ia_openinfo, ia_closeinfo, ia_get_uid, ia_get_gid, ia_get_sgid, ia_get_lvl, ia_get_mask, ia_get_dir, ia_get_sh, ia_get_logpwd, ia_get_logchg, ia_get_logmin, ia_get_logmax, ia_get_logwarn, ia_get_loginact, ia_get_logexpire -- get user identification and authentication information

Synopsis

cc [options] file -liaf
#include <iaf.h>
#include <sys/types.h>
#include <ia.h>

int ia_openinfo(const char *logname, uinfo_t *uinfo);

void ia_closeinfo(uinfo_t uinfo);

void ia_get_uid(uinfo_t uinfo, uid_t *uid);

void ia_get_gid(uinfo_t uinfo, gid_t *gid);

int ia_get_sgid(uinfo_t uinfo, gid_t **sgid, long *cnt);

int ia_get_lvl(uinfo_t uinfo, level_t **lvl, long *cnt);

void ia_get_mask(uinfo_t uinfo, adtemask_t mask);

void ia_get_dir(uinfo_t uinfo, char **dir);

void ia_get_sh(uinfo_t uinfo, char **shell);

void ia_get_logpwd(uinfo_t uinfo, char **passwd);

void ia_get_logchg(uinfo_t uinfo, long *changed);

void ia_get_logmin(uinfo_t uinfo, long *min);

void ia_get_logmax(uinfo_t uinfo, long *max);

void ia_get_logwarn(uinfo_t uinfo, long *warn);

void ia_get_loginact(uinfo_t uinfo, long *inact);

void ia_get_logexpire(uinfo_t uinfo, long *expire);

Description

These functions provide access to user identification and authentication information.

logname
points to a user login name for which the identification and authentication information is to be accessed.

uinfo
is an identifier returned by ia_openinfo through which the information about logname is accessed.

The access to the information (for the given logname) is provided after successfully calling ia_openinfo and remains open until either the process calls ia_closeinfo or the process exits. The results will be indeterminate if the functions are called with the identifier uinfo that was not previously obtained from ia_openinfo, or with the identifier that already has been closed with ia_closeinfo. Therefore, an application should determine when to call ia_closeinfo and if necessary copy the data represented by the identifier to its own address space before such a call takes place.

ia_openinfo opens the access to the identification and authentication information for logname and associates with it an identifier uinfo that is to be used with all other identification and authentication access functions.

ia_closeinfo closes the access to the identification and authentication information for the user identified by uinfo. ia_closeinfo is performed automatically for all identifiers upon calling exit(2).

ia_get_uid returns a pointer to the user ID, uid.

ia_get_gid returns a pointer to the group ID, gid.

ia_get_sgid returns a pointer to an array of supplementary group IDs, sgid_array, and a pointer to a count, cnt.

ia_get_lvl returns a pointer to an array of levels IDs, lvl, and a pointer to the count, cnt.

ia_get_mask returns a pointer to the user audit mask, mask.

ia_get_dir returns a pointer to the user home directory, dir.

ia_get_sh returns a pointer to the name of the user's shell, shell.

ia_get_logpwd returns a pointer to the user login password, passwd.

ia_get_logchg returns a pointer to the date when the login password was last changed, changed.

ia_get_logmin returns a pointer to the minimum days before the login password can change, min.

ia_get_logmax returns a pointer to the number of days that the login password is valid, max.

ia_get_logwarn returns a pointer to the number of days before the login password expires, warn.

ia_get_loginact returns a pointer to the number of days the login may be inactive, inact.

ia_get_logexpire returns a pointer to the date when the login expires, expire.

Return values

Upon successful completion, ia_openinfo returns a value of 0. Otherwise, -1 is returned and the value of uinfo is indeterminate.

All other functions, upon successful completion, will return as an argument either a pointer to the appropriate identification and authentication information, or a NULL pointer on a failure.

Additionally, ia_get_sgid, ia_get_lvl and ia_get_mask return a value of 0 on success and non-zero on failure.

References

group(4), login(1), passwd(1), passwd(4), shadow(4)

Notices

Passwd and group structures will be obtained from NIS, when the dynamic versions of these routines are used, and NIS is installed and running. See passwd(4) and group(4) for the formats of the NIS entries.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004