svcadm(8)을 검색하려면 섹션에서 8 을 선택하고, 맨 페이지 이름에 svcadm을 입력하고 검색을 누른다.
getuserattr(3c)
Standard C Library Functions getuserattr(3C)
NAME
getuserattr, getusernam, getuseruid, free_userattr, setuserattr,
enduserattr, fgetuserattr - get user_attr entry
SYNOPSIS
#include <user_attr.h>
userattr_t *getuserattr(void);
userattr_t *getusernam(const char *name);
userattr_t *getuseruid(uid_t uid);
void free_userattr(userattr_t *userattr);
void setuserattr(void);
void enduserattr(void);
userattr_t *fgetuserattr(FILE *f);
DESCRIPTION
The getuserattr(), getusernam(), and getuseruid() functions each return
a user_attr(5) entry. Entries can come from any of the sources speci‐
fied in the nsswitch.conf(5) file. The getuserattr() function enumer‐
ates user_attr entries. Successive calls to this function returns
either successive user_attr entries or NULL.
The getusernam() function searches for a user_attr entry with a given
user name. The getuseruid() function searches for a user_attr entry
with a given user ID uid. User accounts maintained in the LDAP name
service may have multiple user_attr entries corresponding to specific
hostnames or netgroups which are distinguished by a qualifier field.
The search order gives highest precedence to an entry whose hostname
matches the current hostname, followed by an entry with a netgroup that
includes the current hostname. An entry without any qualifier has the
lowest precedence.
The fgetuserattr() function does not use nsswitch.conf but reads and
parses the next line from the stream f. This stream is assumed to have
the format of the user_attr files.
The free_userattr() function releases memory allocated by the getuser‐
nam(), getuserattr(), and fgetuserattr() functions.
The internal representation of a user_attr entry is a userattr_t struc‐
ture defined in <user_attr.h> with the following members:
char *name; /* name of the user */
char *qualifier; /* optional host or netgroup */
char *res1; /* reserved for future use */
char *res2; /* reserved for future use */
kva_t *attr; /* list of attributes */
The setuserattr() function "rewinds" to the beginning of the enumera‐
tion of user_attr entries. Calls to getusernam() may leave the enumera‐
tion in an indeterminate state, so setuserattr() should be called
before the first call to getuserattr().
The enduserattr() function may be called to indicate that user_attr
processing is complete; the library may then close any open user_attr
file, deallocate any internal storage, and so forth.
RETURN VALUES
The getuserattr() function returns a pointer to a userattr_t if it suc‐
cessfully enumerates an entry; otherwise it returns NULL, indicating
the end of the enumeration.
The getusernam() function returns a pointer to a userattr_t if it suc‐
cessfully locates the requested entry; otherwise it returns NULL.
USAGE
The getuserattr() and getusernam() functions both allocate memory for
the pointers they return. This memory should be deallocated with the
free_userattr() function.
Individual attributes can be referenced in the attr structure by call‐
ing the kva_match(3C) function.
WARNINGS
Because the list of legal keys is likely to expand, code must be writ‐
ten to ignore unknown key-value pairs without error.
FILES
/etc/user_attr extended user attributes
/etc/nsswitch.conf configuration file lookup information for the
name service switch
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
TRIBUTE VALUE _ MT-LevelMT-Safe
SEE ALSO
getauthattr(3C), getexecattr(3C), getprofattr(3C), user_attr(5),
attributes(7)
Oracle Solaris 11.4 17 Aug 2018 getuserattr(3C)