Print this page
9728 3secdb man pages need some tlc
   1 '\" te
   2 .\" Copyright (c) 2005, Sun Microsystems, Inc.  All Rights Reserved.
   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 .\" 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 .\" 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"
   7 .SH NAME
   8 getuserattr, getusernam, getuseruid, free_userattr, setuserattr, enduserattr,
   9 fgetuserattr \- get user_attr entry
  10 .SH SYNOPSIS
  11 .LP
  12 .nf
  13 cc [ \fIflag\fR... ] \fIfile\fR... -lsecdb  -lsocket  -lnsl [ \fIlibrary\fR... ]
  14 #include <user_attr.h>
  15 
  16 \fBuserattr_t *\fR\fBgetuserattr\fR(\fBvoid\fR);
  17 .fi
  18 
  19 .LP
  20 .nf
  21 \fBuserattr_t *\fR\fBgetusernam\fR(\fBconst char *\fR\fI\fR\fIname\fR);
  22 .fi
  23 
  24 .LP
  25 .nf
  26 \fBuserattr_t *\fR\fBgetuseruid\fR(\fBuid_t\fR \fIuid\fR);


  30 .nf
  31 \fBvoid\fR \fBfree_userattr\fR(\fBuserattr_t *\fR\fIuserattr\fR);
  32 .fi
  33 
  34 .LP
  35 .nf
  36 \fBvoid\fR \fBsetuserattr\fR(\fBvoid\fR);
  37 .fi
  38 
  39 .LP
  40 .nf
  41 \fBvoid\fR \fBenduserattr\fR(\fBvoid\fR);
  42 .fi
  43 
  44 .LP
  45 .nf
  46 \fBuserattr_t *\fR\fBfgetuserattr\fR(\fBFILE *\fR\fIf\fR);
  47 .fi
  48 
  49 .SH DESCRIPTION
  50 .sp
  51 .LP
  52 The \fBgetuserattr()\fR, \fBgetusernam()\fR, and \fBgetuseruid()\fR functions
  53 each return a \fBuser_attr\fR(4) entry. Entries can come from any of the
  54 sources specified in the \fBnsswitch.conf\fR(4) file. The \fBgetuserattr()\fR
  55 function enumerates \fBuser_attr\fR entries. The \fBgetusernam()\fR function
  56 searches for a \fBuser_attr\fR entry with a given user name \fIname\fR. The
  57 \fBgetuseruid()\fR function searches for a \fBuser_attr\fR entry with a given
  58 user ID \fIuid\fR. Successive calls to these functions return either successive
  59 \fBuser_attr\fR entries or \fINULL\fR.
  60 .sp
  61 .LP
  62 The \fBfgetuserattr()\fR function does not use \fBnsswitch.conf\fR but reads
  63 and parses the next line from the stream \fIf\fR. This stream is assumed to
  64 have the format of the \fBuser_attr\fR files.
  65 .sp
  66 .LP
  67 The \fBfree_userattr()\fR function releases memory allocated by the
  68 \fBgetusernam()\fR, \fBgetuserattr()\fR, and \fBfgetuserattr()\fR functions.
  69 .sp
  70 .LP


  76 char  *name;       /* name of the user */
  77 char  *qualifier;  /* reserved for future use */
  78 char  *res1;       /* reserved for future use */
  79 char  *res2;       /* reserved for future use */
  80 kva_t *attr;       /* list of attributes */
  81 .fi
  82 .in -2
  83 
  84 .sp
  85 .LP
  86 The \fBsetuserattr()\fR function "rewinds" to the beginning of the enumeration
  87 of \fBuser_attr\fR entries.  Calls to \fBgetusernam()\fR may leave the
  88 enumeration in an indeterminate state, so \fBsetuserattr()\fR should be called
  89 before the first call to \fBgetuserattr()\fR.
  90 .sp
  91 .LP
  92 The \fBenduserattr()\fR function may be called to indicate that \fBuser_attr\fR
  93 processing is complete; the library may then close any open \fBuser_attr\fR
  94 file, deallocate any internal storage, and so forth.
  95 .SH RETURN VALUES
  96 .sp
  97 .LP
  98 The \fBgetuserattr()\fR function returns a pointer to a \fBuserattr_t\fR if it
  99 successfully enumerates an entry; otherwise it returns \fINULL\fR, indicating
 100 the end of the enumeration.
 101 .sp
 102 .LP
 103 The \fBgetusernam()\fR function returns a pointer to a \fBuserattr_t\fR if it
 104 successfully locates the requested entry; otherwise it returns \fINULL\fR.
 105 .SH USAGE
 106 .sp
 107 .LP
 108 The \fBgetuserattr()\fR and \fBgetusernam()\fR functions both allocate memory
 109 for the pointers they return. This memory should be deallocated with the
 110 \fBfree_userattr()\fR function.
 111 .sp
 112 .LP
 113 Individual attributes can be referenced in the \fBattr\fR structure by calling
 114 the \fBkva_match\fR(3SECDB) function.
 115 .SH WARININGS
 116 .sp
 117 .LP
 118 Because the list of legal keys is likely to expand, code  must be written to
 119 ignore unknown key-value pairs without error.
 120 .SH FILES
 121 .sp
 122 .ne 2
 123 .na
 124 \fB\fB/etc/user_attr\fR\fR
 125 .ad
 126 .RS 22n
 127 extended user attributes
 128 .RE
 129 
 130 .sp
 131 .ne 2
 132 .na
 133 \fB\fB/etc/nsswitch.conf\fR\fR
 134 .ad
 135 .RS 22n
 136 configuration file lookup information for the name server switch
 137 .RE
 138 
 139 .SH ATTRIBUTES
 140 .sp
 141 .LP
 142 See \fBattributes\fR(5) for descriptions of the following attributes:
 143 .sp
 144 
 145 .sp
 146 .TS
 147 box;
 148 c | c
 149 l | l .
 150 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 151 _
 152 MT-Level        MT-Safe
 153 .TE
 154 
 155 .SH SEE ALSO
 156 .sp
 157 .LP
 158 \fBgetauthattr\fR(3SECDB), \fBgetexecattr\fR(3SECDB),
 159 \fBgetprofattr\fR(3SECDB), \fBuser_attr\fR(4), \fBattributes\fR(5)

   1 '\" te
   2 .\" Copyright (c) 2005, Sun Microsystems, Inc.  All Rights Reserved.
   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 .\" 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 .\" 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 "Aug 13, 2018"
   7 .SH NAME
   8 getuserattr, getusernam, getuseruid, free_userattr, setuserattr, enduserattr,
   9 fgetuserattr \- get user_attr entry
  10 .SH SYNOPSIS
  11 .LP
  12 .nf
  13 cc [ \fIflag\fR... ] \fIfile\fR... -lsecdb  -lsocket  -lnsl [ \fIlibrary\fR... ]
  14 #include <user_attr.h>
  15 
  16 \fBuserattr_t *\fR\fBgetuserattr\fR(\fBvoid\fR);
  17 .fi
  18 
  19 .LP
  20 .nf
  21 \fBuserattr_t *\fR\fBgetusernam\fR(\fBconst char *\fR\fI\fR\fIname\fR);
  22 .fi
  23 
  24 .LP
  25 .nf
  26 \fBuserattr_t *\fR\fBgetuseruid\fR(\fBuid_t\fR \fIuid\fR);


  30 .nf
  31 \fBvoid\fR \fBfree_userattr\fR(\fBuserattr_t *\fR\fIuserattr\fR);
  32 .fi
  33 
  34 .LP
  35 .nf
  36 \fBvoid\fR \fBsetuserattr\fR(\fBvoid\fR);
  37 .fi
  38 
  39 .LP
  40 .nf
  41 \fBvoid\fR \fBenduserattr\fR(\fBvoid\fR);
  42 .fi
  43 
  44 .LP
  45 .nf
  46 \fBuserattr_t *\fR\fBfgetuserattr\fR(\fBFILE *\fR\fIf\fR);
  47 .fi
  48 
  49 .SH DESCRIPTION

  50 .LP
  51 The \fBgetuserattr()\fR, \fBgetusernam()\fR, and \fBgetuseruid()\fR functions
  52 each return a \fBuser_attr\fR(4) entry. Entries can come from any of the
  53 sources specified in the \fBnsswitch.conf\fR(4) file. The \fBgetuserattr()\fR
  54 function enumerates \fBuser_attr\fR entries. The \fBgetusernam()\fR function
  55 searches for a \fBuser_attr\fR entry with a given user name \fIname\fR. The
  56 \fBgetuseruid()\fR function searches for a \fBuser_attr\fR entry with a given
  57 user ID \fIuid\fR. Successive calls to these functions return either successive
  58 \fBuser_attr\fR entries or \fINULL\fR.
  59 .sp
  60 .LP
  61 The \fBfgetuserattr()\fR function does not use \fBnsswitch.conf\fR but reads
  62 and parses the next line from the stream \fIf\fR. This stream is assumed to
  63 have the format of the \fBuser_attr\fR files.
  64 .sp
  65 .LP
  66 The \fBfree_userattr()\fR function releases memory allocated by the
  67 \fBgetusernam()\fR, \fBgetuserattr()\fR, and \fBfgetuserattr()\fR functions.
  68 .sp
  69 .LP


  75 char  *name;       /* name of the user */
  76 char  *qualifier;  /* reserved for future use */
  77 char  *res1;       /* reserved for future use */
  78 char  *res2;       /* reserved for future use */
  79 kva_t *attr;       /* list of attributes */
  80 .fi
  81 .in -2
  82 
  83 .sp
  84 .LP
  85 The \fBsetuserattr()\fR function "rewinds" to the beginning of the enumeration
  86 of \fBuser_attr\fR entries.  Calls to \fBgetusernam()\fR may leave the
  87 enumeration in an indeterminate state, so \fBsetuserattr()\fR should be called
  88 before the first call to \fBgetuserattr()\fR.
  89 .sp
  90 .LP
  91 The \fBenduserattr()\fR function may be called to indicate that \fBuser_attr\fR
  92 processing is complete; the library may then close any open \fBuser_attr\fR
  93 file, deallocate any internal storage, and so forth.
  94 .SH RETURN VALUES

  95 .LP
  96 The \fBgetuserattr()\fR function returns a pointer to a \fBuserattr_t\fR if it
  97 successfully enumerates an entry; otherwise it returns \fINULL\fR, indicating
  98 the end of the enumeration.
  99 .sp
 100 .LP
 101 The \fBgetusernam()\fR function returns a pointer to a \fBuserattr_t\fR if it
 102 successfully locates the requested entry; otherwise it returns \fINULL\fR.
 103 .SH USAGE

 104 .LP
 105 The \fBgetuserattr()\fR and \fBgetusernam()\fR functions both allocate memory
 106 for the pointers they return. This memory should be deallocated with the
 107 \fBfree_userattr()\fR function.
 108 .sp
 109 .LP
 110 Individual attributes can be referenced in the \fBattr\fR structure by calling
 111 the \fBkva_match\fR(3SECDB) function.
 112 .SH WARNINGS

 113 .LP
 114 Because the list of legal keys is likely to expand, code must be written to
 115 ignore unknown key-value pairs without error.
 116 .SH FILES

 117 .ne 2
 118 .na
 119 \fB\fB/etc/user_attr\fR\fR
 120 .ad
 121 .RS 22n
 122 extended user attributes
 123 .RE
 124 
 125 .sp
 126 .ne 2
 127 .na
 128 \fB\fB/etc/nsswitch.conf\fR\fR
 129 .ad
 130 .RS 22n
 131 configuration file lookup information for the name service switch
 132 .RE
 133 
 134 .SH ATTRIBUTES

 135 .LP
 136 See \fBattributes\fR(5) for descriptions of the following attributes:
 137 .sp
 138 
 139 .sp
 140 .TS
 141 box;
 142 c | c
 143 l | l .
 144 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 145 _
 146 MT-Level        MT-Safe
 147 .TE
 148 
 149 .SH SEE ALSO

 150 .LP
 151 \fBgetauthattr\fR(3SECDB), \fBgetexecattr\fR(3SECDB),
 152 \fBgetprofattr\fR(3SECDB), \fBkva_match\fR(3SECDB), \fBuser_attr\fR(4),
 153 \fBattributes\fR(5)