secdef(3) secdef(3)
NAME [Toc] [Back]
secdef - security defaults configuration file routines
SYNOPSIS [Toc] [Back]
#include <prot.h>
int open_secdef (void);
int close_secdef (void);
int get_secdef_str(char *parameter, char *value);
int get_secdef_int(char *parameter, char *value);
DESCRIPTION [Toc] [Back]
open_secdef opens the security configuration file
/etc/default/security. This function must be called prior to calling
get_secdef_str or get_secdef_int.
close_secdef closes the security configuration file.
get_secdef_str and get_secdef_int return the value of the specified
parameter defined in the security configuration file. See the
security(4) manpage.
Programs using these routines must be compiled with -lsec.
APPLICATION USAGE [Toc] [Back]
In a multithreaded application, these interfaces are thread-safe, but
not async-cancel-safe. A cancellation point may occur when a thread
is executing any of these interfaces.
RETURN VALUE [Toc] [Back]
open_secdef returns a value of 0 if the open completed successfully.
Otherwise, it returns -1 and leaves errno unchanged from the fstat
call. get_secdef_str and get_secdef_int return the following:
0 The value of the specified parameter was successfully
returned.
-1 The entry was not found, or the security configuration file
was not opened.
-2 The format of the entry was incorrect.
EXAMPLES [Toc] [Back]
This example obtains the "path" from the SU_DEFAULT_PATH=<path>
parameter.
char supath[MAXPATHLEN+100];
if (open_secdef() == 0) {
if (get_secdef_str("SU_DEFAULT_PATH", supath) == 0)
Hewlett-Packard Company - 1 - HP-UX 11i Version 2: Sep 2004
secdef(3) secdef(3)
printf("su path is %s", supath);
close_secdef()
}
FILES [Toc] [Back]
/etc/default/security Security defaults configuration file.
SEE ALSO [Toc] [Back]
security(4).
Hewlett-Packard Company - 2 - HP-UX 11i Version 2: Sep 2004 [ Back ] |