Print this page
9728 3secdb man pages need some tlc
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3secdb/getuserattr.3secdb
+++ new/usr/src/man/man3secdb/getuserattr.3secdb
1 1 '\" te
2 2 .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
3 3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 -.TH GETUSERATTR 3SECDB "Mar 31, 2005"
6 +.TH GETUSERATTR 3SECDB "Aug 13, 2018"
7 7 .SH NAME
8 8 getuserattr, getusernam, getuseruid, free_userattr, setuserattr, enduserattr,
9 9 fgetuserattr \- get user_attr entry
10 10 .SH SYNOPSIS
11 11 .LP
12 12 .nf
13 13 cc [ \fIflag\fR... ] \fIfile\fR... -lsecdb -lsocket -lnsl [ \fIlibrary\fR... ]
14 14 #include <user_attr.h>
15 15
16 16 \fBuserattr_t *\fR\fBgetuserattr\fR(\fBvoid\fR);
17 17 .fi
18 18
19 19 .LP
20 20 .nf
21 21 \fBuserattr_t *\fR\fBgetusernam\fR(\fBconst char *\fR\fI\fR\fIname\fR);
22 22 .fi
23 23
24 24 .LP
25 25 .nf
26 26 \fBuserattr_t *\fR\fBgetuseruid\fR(\fBuid_t\fR \fIuid\fR);
27 27 .fi
28 28
29 29 .LP
30 30 .nf
31 31 \fBvoid\fR \fBfree_userattr\fR(\fBuserattr_t *\fR\fIuserattr\fR);
32 32 .fi
33 33
34 34 .LP
35 35 .nf
36 36 \fBvoid\fR \fBsetuserattr\fR(\fBvoid\fR);
37 37 .fi
38 38
39 39 .LP
↓ open down ↓ |
23 lines elided |
↑ open up ↑ |
40 40 .nf
41 41 \fBvoid\fR \fBenduserattr\fR(\fBvoid\fR);
42 42 .fi
43 43
44 44 .LP
45 45 .nf
46 46 \fBuserattr_t *\fR\fBfgetuserattr\fR(\fBFILE *\fR\fIf\fR);
47 47 .fi
48 48
49 49 .SH DESCRIPTION
50 -.sp
51 50 .LP
52 51 The \fBgetuserattr()\fR, \fBgetusernam()\fR, and \fBgetuseruid()\fR functions
53 52 each return a \fBuser_attr\fR(4) entry. Entries can come from any of the
54 53 sources specified in the \fBnsswitch.conf\fR(4) file. The \fBgetuserattr()\fR
55 54 function enumerates \fBuser_attr\fR entries. The \fBgetusernam()\fR function
56 55 searches for a \fBuser_attr\fR entry with a given user name \fIname\fR. The
57 56 \fBgetuseruid()\fR function searches for a \fBuser_attr\fR entry with a given
58 57 user ID \fIuid\fR. Successive calls to these functions return either successive
59 58 \fBuser_attr\fR entries or \fINULL\fR.
60 59 .sp
61 60 .LP
62 61 The \fBfgetuserattr()\fR function does not use \fBnsswitch.conf\fR but reads
63 62 and parses the next line from the stream \fIf\fR. This stream is assumed to
64 63 have the format of the \fBuser_attr\fR files.
65 64 .sp
66 65 .LP
67 66 The \fBfree_userattr()\fR function releases memory allocated by the
68 67 \fBgetusernam()\fR, \fBgetuserattr()\fR, and \fBfgetuserattr()\fR functions.
69 68 .sp
70 69 .LP
71 70 The internal representation of a \fBuser_attr\fR entry is a \fBuserattr_t\fR
72 71 structure defined in <\fBuser_attr.h\fR> with the following members:
73 72 .sp
74 73 .in +2
75 74 .nf
76 75 char *name; /* name of the user */
77 76 char *qualifier; /* reserved for future use */
78 77 char *res1; /* reserved for future use */
79 78 char *res2; /* reserved for future use */
80 79 kva_t *attr; /* list of attributes */
81 80 .fi
82 81 .in -2
83 82
84 83 .sp
85 84 .LP
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
86 85 The \fBsetuserattr()\fR function "rewinds" to the beginning of the enumeration
87 86 of \fBuser_attr\fR entries. Calls to \fBgetusernam()\fR may leave the
88 87 enumeration in an indeterminate state, so \fBsetuserattr()\fR should be called
89 88 before the first call to \fBgetuserattr()\fR.
90 89 .sp
91 90 .LP
92 91 The \fBenduserattr()\fR function may be called to indicate that \fBuser_attr\fR
93 92 processing is complete; the library may then close any open \fBuser_attr\fR
94 93 file, deallocate any internal storage, and so forth.
95 94 .SH RETURN VALUES
96 -.sp
97 95 .LP
98 96 The \fBgetuserattr()\fR function returns a pointer to a \fBuserattr_t\fR if it
99 97 successfully enumerates an entry; otherwise it returns \fINULL\fR, indicating
100 98 the end of the enumeration.
101 99 .sp
102 100 .LP
103 101 The \fBgetusernam()\fR function returns a pointer to a \fBuserattr_t\fR if it
104 102 successfully locates the requested entry; otherwise it returns \fINULL\fR.
105 103 .SH USAGE
106 -.sp
107 104 .LP
108 105 The \fBgetuserattr()\fR and \fBgetusernam()\fR functions both allocate memory
109 106 for the pointers they return. This memory should be deallocated with the
110 107 \fBfree_userattr()\fR function.
111 108 .sp
112 109 .LP
113 110 Individual attributes can be referenced in the \fBattr\fR structure by calling
114 111 the \fBkva_match\fR(3SECDB) function.
115 -.SH WARININGS
116 -.sp
112 +.SH WARNINGS
117 113 .LP
118 -Because the list of legal keys is likely to expand, code must be written to
114 +Because the list of legal keys is likely to expand, code must be written to
119 115 ignore unknown key-value pairs without error.
120 116 .SH FILES
121 -.sp
122 117 .ne 2
123 118 .na
124 119 \fB\fB/etc/user_attr\fR\fR
125 120 .ad
126 121 .RS 22n
127 122 extended user attributes
128 123 .RE
129 124
130 125 .sp
131 126 .ne 2
132 127 .na
133 128 \fB\fB/etc/nsswitch.conf\fR\fR
134 129 .ad
135 130 .RS 22n
136 -configuration file lookup information for the name server switch
131 +configuration file lookup information for the name service switch
137 132 .RE
138 133
139 134 .SH ATTRIBUTES
140 -.sp
141 135 .LP
142 136 See \fBattributes\fR(5) for descriptions of the following attributes:
143 137 .sp
144 138
145 139 .sp
146 140 .TS
147 141 box;
148 142 c | c
149 143 l | l .
150 144 ATTRIBUTE TYPE ATTRIBUTE VALUE
151 145 _
152 146 MT-Level MT-Safe
153 147 .TE
154 148
155 149 .SH SEE ALSO
156 -.sp
157 150 .LP
158 151 \fBgetauthattr\fR(3SECDB), \fBgetexecattr\fR(3SECDB),
159 -\fBgetprofattr\fR(3SECDB), \fBuser_attr\fR(4), \fBattributes\fR(5)
152 +\fBgetprofattr\fR(3SECDB), \fBkva_match\fR(3SECDB), \fBuser_attr\fR(4),
153 +\fBattributes\fR(5)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX