seclib_misc(3C) seclib_misc(3C)
NAME
seclibmisc - miscellaneous security library functions
SYNOPSIS
cc ... -lseclib
#include <seclib.h>
enum seclibreturnval
seclibgetflag(enum seclibflag flag, void (*value));
enum seclibreturnval
seclibsetdefaultfile(char *filename);
int
seclibiscspinstalled(void);
char *
seclibgeterror(struct logincontext *context);
enum seclibreturnval
seclibduplastlog(const struct lastlog *orig,
struct lastlog **copy);
enum seclibreturnval
seclibfreelastlog(struct lastlog *freeme);
enum seclibreturnval
seclibreadlastlog(struct logincontext *);
enum seclibreturnval
seclibwritelastlog(struct logincontext *);
int
seclibrwlastlog(uidt uid, int writeflag, struct lastlog *ll);
enum seclibreturnval
seclibduppass(const struct passwd *orig, struct passwd **copy);
enum seclibreturnval
seclibdupshad(const struct spwd *orig, struct spwd **copy);
enum seclibreturnval
seclibdupgroup(const struct group *orig, struct group **copy);
enum seclibreturnval
seclibfreepass(struct passwd *freeme);
enum seclibreturnval
seclibfreeshad(struct spwd *freeme);
Page 1 Reliant UNIX 5.44 Printed 11/98
seclib_misc(3C) seclib_misc(3C)
enum seclibreturnval
seclibfreegroup(struct group *freeme);
DESCRIPTION
The Miscellaneous group provides the following functionality:
- convenient access to flag values from the /etc/default/login file.
- duplication and free of various data structures.
- access to the /var/adm/lastlog file.
- composition of error messages from the context reason codes.
- detection of the installation of the CSP product.
seclibgetflag
Reads a flag value from /etc/default/login.
seclibsetdefaultfile
Specifies an alternate file for the seclibgetflag() function.
seclibiscspinstalled
Returns the true value (1) if the CSP product is installed, false
(0) otherwise.
seclibgeterror
Returns an allocated string which contains a textual message
describing the success/failure reasons in the login context.
seclibreadlastlog
seclibwritelastlog
seclibrwlastlog
Read/write the /var/adm/lastlog file.
seclibduppass
seclibdupshad
seclibdupgroup
seclibduplastlog
Duplicate the given structure.
seclibfreepass
seclibfreeshad
seclibfreegroup
seclibfreelastlog
Free the storage allocated for the given structure.
Page 2 Reliant UNIX 5.44 Printed 11/98
seclib_misc(3C) seclib_misc(3C)
ARGUMENTS
logincontext
A value as returned by secliblogincontext(). The structure
referenced by this pointer contains all of the session informa-
tion required to authenticate a user via the security library.
enum seclibflag flag
The value in /etc/default/login that is to be looked up and
returned.
void (*value)
A pointer into which the value of the flag (from
/etc/default/login) will be placed. If this pointer has a NULL
value, it will be ignored.
char *filename
An alternate file to be used for seclibgetflag(). If NULL is
passed, /etc/default/login will be used.
struct lastlog *freeme
struct passwd *freeme
struct group *freeme
struct spwd *freeme
A pointer to the (given) structure to be freed.
struct lastlog *orig
struct passwd *orig
struct group *orig
struct spwd *orig
Pointers to the (given) structure to be copied.
struct lastlog **copy
struct passwd **copy
struct group **copy
struct spwd **copy
Pointers to the (given) structure pointers. The allocated new
structure copy address will be placed in the pointer.
struct lastlog *ll
A pointer to a lastlog structure.
uidt uid
The user id for which a lastlog structure is to be read or writ-
ten.
int writeflag
A flag indicating whether the lastlog structure would be read or
written (1==write, 0==read).
Page 3 Reliant UNIX 5.44 Printed 11/98
seclib_misc(3C) seclib_misc(3C)
RETURN VALUE
Most functions return the seclibreturnval enumeration. These func-
tions will return:
SECROK
The function completed processing without encountering a system
error. SECROK is also returned by seclib_getflag when a boolean
"yes" value for a flag is read.
NOTE: the function will return SECROK even if it sets
context->reason to a failure value.
SECRFALSE
The seclibgetflag function will return SECRFALSE when a boolean
"no" value for a flag is read.
SECRCALLFAILED
The function call failed. This is usually because a system call
failed (such as a malloc() failing when a brk() call returned
with an error).
SECRBADOPTION
The function was called with an invalid argument.
FILES
/var/adm/lastlog
SEE ALSO
seclib(3C), secliblogincontext(3C), seclibpassentry(3C),
seclibpassqual(3C), seclibpasswd(3C), seclibruserok(3C),
seclibsecterm(3C), seclibtwindows(3C).
Page 4 Reliant UNIX 5.44 Printed 11/98