Security Attributes Database Library Functions
getprofattr(3SECDB)
NAME
getprofattr, getprofnam, freeprofattr, setprofattr,
endprofattr, getproflist, freeproflist - get profile
description and attributes
SYNOPSIS
cc [ flag... ] file... -lsecdb -lsocket -lnsl [ library... ]
#include
profattrt *getprofattr(void);
profattrt *getprofnam(const char *name);
void freeprofattr(profattrt *pd);
void setprofattr(void);
void endprofattr(void);
void getproflist(const char *profname, char **proflist, int *profcnt);
void freeproflist(char **proflist, int profcnt);
DESCRIPTION
The getprofattr() and getprofnam() functions each return a
profattr entry. Entries can come from any of the sources
specified in the nsswitch.conf(4) file.
The getprofattr() function enumerates profattr entries. The
getprofnam() function searches for a profattr entry with a
given name. Successive calls to these functions return
either successive profattr entries or NUL.
The internal representation of a profattr entry is a
profattrt structure defined in with the fol-
lowing members:
char *name; /* Name of the profile */
char *res1; /* Reserved for future use */
char *res2; /* Reserved for future use */
char *desc; /* Description/Purpose of the profile */
kvat *attr; /* Profile attributes */
SunOS 5.11 Last change: 31 Mar 2005 1
Security Attributes Database Library Functions
getprofattr(3SECDB)
The freeprofattr() function releases memory allocated by
the getprofattr() and getprofnam() functions.
The setprofattr() function "rewinds" to the beginning of the
enumeration of profattr entries. Calls to getprofnam() can
leave the enumeration in an indeterminate state. Therefore,
setprofattr() should be called before the first call to get-
profattr().
The endprofattr() function may be called to indicate that
profattr processing is complete; the system may then close
any open profattr file, deallocate storage, and so forth.
The getproflist() function searches for the list of sub-
profiles found in the given profname and allocates memory to
store this list in proflist. The given profname will be
included in the list of sub-profiles. The profcnt argument
indicates the number of items currently valid in proflist.
Memory allocated by getproflist() should be freed using the
freeproflist() function.
The freeproflist() function frees memory allocated by the
getproflist() function. The profcnt argument specifies the
number of items to free from the proflist argument.
RETURN VALUES
The getprofattr() function returns a pointer to a profattrt
if it successfully enumerates an entry; otherwise it returns
NUL, indicating the end of the enumeration.
The getprofnam() function returns a pointer to a profattrt
if it successfully locates the requested entry; otherwise it
returns NUL.
USAGE
Individual attributes in the profattrt structure can be
referred to by calling the kvamatch(3SECDB) function.
Because the list of legal keys is likely to expand, any code
must be written to ignore unknown key-value pairs without
error.
The getprofattr() and getprofnam() functions both allocate
memory for the pointers they return. This memory should be
SunOS 5.11 Last change: 31 Mar 2005 2
Security Attributes Database Library Functions
getprofattr(3SECDB)
deallocated with the freeprofattr() function.
FILES
/etc/security/profattr profiles and their descriptions
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
MT-Level MT-Safe
SEE ALSO
auths(1), profiles(1), getexecattr(3SECDB),
getauthattr(3SECDB), profattr(4)
SunOS 5.11 Last change: 31 Mar 2005 3
Security Attributes Database Library Functions
getprofattr(3SECDB)
SunOS 5.11 Last change: 31 Mar 2005 4
|