Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/man/man3c/getuserattrnam.3c
Real path: /usr/share/man/man3c/getuserattrnam.3c
Zurück
'\" te .\" Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. .TH getuserattrnam 3C "22 Aug 2012" "Oracle Solaris 11.4" "Standard C Library Functions" .SH NAME getuserattrnam \- get a user's attribute .SH SYNOPSIS .LP .nf #include <user_attr.h> char *getuserattrnam(const char *\fIuser\fR, const char *\fIkey\fR, char **\fIwhere\fR, const char *\fIdeflt\fR); .fi .LP .nf char *getuserattruid(const uid_t \fIuserid\fR, const char *\fIkey\fR, char **\fIwhere\fR, const char *\fIdeflt\fR); .fi .SH DESCRIPTION .sp .LP The \fBgetuserattrnam()\fR function returns the first attribute value associated with \fIkey\fR for \fIuser\fR by searching first the attributes directly assigned to the user in \fBuser_attr\fR(5), then the attributes of the profiles of the user, and finally an administrator-defined local default in the "defaults" style \fIdeflt\fR file path. If \fIdeflt\fR is \fINULL\fR, \fBpolicy.conf\fR(5) is used. If \fIwhere\fR is non-null, the source of the returned value is returned in it. For example, the source could be \fBuser_attr\fR, a Rights Profile name, or a "defaults" style file path name. .sp .LP The \fBgetuserattruid()\fR function operates the same as the \fBgetuserattrnam()\fR function except that it takes a user ID rather then a user name for its first parameter. .SH RETURN VALUES .sp .LP These functions return the value found for the user's attribute key. They return \fINULL\fR if the no value found or if an error such as \fBENOMEM\fR occurred. The value returned and, if specified, the value returned in \fIwhere\fR should be released when no longer in use with \fBfree\fR(3C). .SH ERRORS .sp .ne 2 .mk .na \fB\fBENOMEM\fR\fR .ad .RS 10n .rt There is insufficient memory to return the attribute value. .RE .SH EXAMPLES .LP \fBExample 1\fR Determine if the process is being run by a role. .sp .in +2 .nf #include <string.h> #include <unistd.h> #include <user_attr.h> \&... char *type; if ((type = getuserattruid(getuid(), USERATTR_TYPE_KW, NULL, NULL)) != NULL) && (strcmp(type, USERATTR_TYPE_ROLE) == 0)) { /* is a role */ } else { /* not a role */ } .fi .in -2 .sp .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Committed _ MT-Level MT-Safe .TE .sp .SH SEE ALSO .sp .LP \fBfree\fR(3C), \fBpolicy.conf\fR(5), \fBprof_attr\fR(5), \fBuser_attr\fR(5), \fBattributes\fR(7)