/usr/include/libuser/entity.h is in libuser1-dev 1:0.60~dfsg-1.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | /*
* Copyright (C) 2000-2002 Red Hat, Inc.
*
* This is free software; you can redistribute it and/or modify it under
* the terms of the GNU Library General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef libuser_entity_h
#define libuser_entity_h
#include <sys/types.h>
#include <stdio.h>
#include <glib.h>
#include <glib-object.h>
G_BEGIN_DECLS
/**
* lu_ent:
*
* An opaque structure used to hold data about a particular user or group
* account.
*
* Each struct lu_ent contains two sets of attributes: pending and current.
* The pending attributes are modified by default, the current attributes are
* modified by functions ending with _current.
*
* Each attribute contains a list of values. The list is never empty; removing
* the last entry from the list removes the list completely.
*/
struct lu_ent;
#ifndef LU_DISABLE_DEPRECATED
/**
* lu_ent_t:
*
* An alias for struct #lu_ent.
* Deprecated: 0.57.3: Use struct #lu_ent directly.
*/
typedef struct lu_ent lu_ent_t;
#endif
/* Attributes carried by all user structures. */
/**
* LU_USERNAME:
*
* User name, a %G_TYPE_STRING.
*/
#define LU_USERNAME "pw_name"
/**
* LU_USERPASSWORD:
*
* User password, a %G_TYPE_STRING. If shadow passwords are used, this is the
* placeholder password.
*
* Don't modify passwords by changing this attribute directly, use one of the
* specialized functions.
*/
#define LU_USERPASSWORD "pw_passwd"
/**
* LU_UIDNUMBER:
*
* User ID, an #id_t.
*/
#define LU_UIDNUMBER "pw_uid"
/**
* LU_GIDNUMBER:
*
* Group ID, an #id_t.
*/
#define LU_GIDNUMBER "pw_gid"
/**
* LU_GECOS:
*
* Usually user's real name, a %G_TYPE_STRING. Often contains user's real name,
* office name, office phone, home phone, separated by commas.
*/
#define LU_GECOS "pw_gecos"
/**
* LU_HOMEDIRECTORY:
*
* User's home directory, a %G_TYPE_STRING.
*/
#define LU_HOMEDIRECTORY "pw_dir"
/**
* LU_LOGINSHELL:
*
* User's login shell, a %G_TYPE_STRING.
*/
#define LU_LOGINSHELL "pw_shell"
/* Attributes carried by group structures. */
/**
* LU_GROUPNAME:
*
* Group name, a %G_TYPE_STRING.
*/
#define LU_GROUPNAME "gr_name"
/**
* LU_GROUPPASSWORD:
*
* Group password, a %G_TYPE_STRING.
*
* Don't modify passwords by changing this attribute directly, use one of the
* specialized functions.
*/
#define LU_GROUPPASSWORD "gr_passwd"
/* #define LU_GIDNUMBER "gr_gid" */
/**
* LU_MEMBERNAME:
*
* Group member names; each member is represented by a separate %G_TYPE_STRING
* value.
*/
#define LU_MEMBERNAME "gr_mem"
/**
* LU_ADMINISTRATORNAME:
*
* Group administrator names; each administrator is represented by a separate
* %G_TYPE_STRING value.
*/
#define LU_ADMINISTRATORNAME "gr_adm"
/* Attributes carried by shadow user structures. */
/**
* LU_SHADOWNAME:
*
* User name, a %G_TYPE_STRING. Note that %LU_SHADOWNAME is not distinct from
* %LU_USERNAME.
*/
#define LU_SHADOWNAME LU_USERNAME
/**
* LU_SHADOWPASSWORD:
*
* User password in the shadow file, a %G_TYPE_STRING.
*
* Don't modify passwords by changing this attribute directly, use one of the
* specialized functions.
*/
#define LU_SHADOWPASSWORD "sp_pwdp"
/**
* LU_SHADOWLASTCHANGE:
*
* The number of days since the epoch to the day when the password was last
* changed, a %G_TYPE_LONG.
*
* May be -1 to indicate that the field exists without a value. This should be
* handled the same as if the attribute was missing altogether, and consistently
* with shadow(5).
*/
#define LU_SHADOWLASTCHANGE "sp_lstchg"
/**
* LU_SHADOWMIN:
*
* Minimum password lifetime in days before it can be changed, a %G_TYPE_LONG.
*
* May be -1 to indicate that the field exists without a value. This should be
* handled the same as if the attribute was missing altogether, and consistently
* with shadow(5).
*/
#define LU_SHADOWMIN "sp_min"
/**
* LU_SHADOWMAX:
*
* Maximum password lifetime in days before it must be changed, a %G_TYPE_LONG.
*
* May be -1 to indicate that the field exists without a value. This should be
* handled the same as if the attribute was missing altogether, and consistently
* with shadow(5).
*/
#define LU_SHADOWMAX "sp_max"
/**
* LU_SHADOWWARNING:
*
* Days before the password lifetime expires when the user should start to be
* warned, a %G_TYPE_LONG.
*
* May be -1 to indicate that the field exists without a value. This should be
* handled the same as if the attribute was missing altogether, and consistently
* with shadow(5).
*/
#define LU_SHADOWWARNING "sp_warn"
/**
* LU_SHADOWINACTIVE:
*
* Days after the password lifetime expires when the user account is disabled
* (because it is considered inactive), a %G_TYPE_LONG. -1 to disable inactive
* account disabling.
*/
#define LU_SHADOWINACTIVE "sp_inact"
/**
* LU_SHADOWEXPIRE:
*
* The number of days since the epoch to the day when the account expires and
* is disabled, a %G_TYPE_LONG. -1 to disable account expiration.
*/
#define LU_SHADOWEXPIRE "sp_expire"
/**
* LU_SHADOWFLAG:
*
* A reserved value "for future use", a %G_TYPE_LONG. In most cases the value
* is -1.
*/
#define LU_SHADOWFLAG "sp_flag"
/* Additional fields carried by some structures. If they have them,
* it's safe to change them. */
/**
* LU_COMMONNAME:
*
* User's real name, a %G_TYPE_STRING.
*/
#define LU_COMMONNAME "cn"
/**
* LU_GIVENNAME:
*
* User's given name, a %G_TYPE_STRING.
*/
#define LU_GIVENNAME "givenName"
/**
* LU_SN:
*
* User's surname, a %G_TYPE_STRING.
*/
#define LU_SN "sn"
/**
* LU_ROOMNUMBER:
*
* User's room number, a %G_TYPE_STRING.
*/
#define LU_ROOMNUMBER "roomNumber"
/**
* LU_TELEPHONENUMBER:
*
* User's telephone number, a %G_TYPE_STRING.
*/
#define LU_TELEPHONENUMBER "telephoneNumber"
/**
* LU_HOMEPHONE:
*
* User's home telephone number, a %G_TYPE_STRING.
*/
#define LU_HOMEPHONE "homePhone"
/**
* LU_EMAIL:
*
* User's email address, a %G_TYPE_STRING.
*/
#define LU_EMAIL "mail"
struct lu_ent *lu_ent_new(void);
void lu_ent_free(struct lu_ent *ent);
void lu_ent_copy(struct lu_ent *source, struct lu_ent *dest);
void lu_ent_revert(struct lu_ent *ent);
void lu_ent_commit(struct lu_ent *ent);
GValueArray *lu_ent_get_current(struct lu_ent *ent, const char *attribute);
const char *lu_ent_get_first_string_current(struct lu_ent *ent,
const char *attribute);
char *lu_ent_get_first_value_strdup_current(struct lu_ent *ent,
const char *attribute);
id_t lu_ent_get_first_id_current(struct lu_ent *ent, const char *attribute);
gboolean lu_ent_has_current(struct lu_ent *ent, const char *attribute);
void lu_ent_set_current(struct lu_ent *ent, const char *attr,
const GValueArray *values);
void lu_ent_set_string_current(struct lu_ent *ent, const char *attr,
const char *value);
void lu_ent_set_id_current(struct lu_ent *ent, const char *attr, id_t value);
void lu_ent_set_long_current(struct lu_ent *ent, const char *attr,
long int value);
void lu_ent_add_current(struct lu_ent *ent, const char *attr,
const GValue *value);
void lu_ent_clear_current(struct lu_ent *ent, const char *attr);
void lu_ent_clear_all_current(struct lu_ent *ent);
void lu_ent_del_current(struct lu_ent *ent, const char *attr,
const GValue *value);
GList *lu_ent_get_attributes_current(struct lu_ent *ent);
GValueArray *lu_ent_get(struct lu_ent *ent, const char *attribute);
const char *lu_ent_get_first_string(struct lu_ent *ent, const char *attribute);
char *lu_ent_get_first_value_strdup(struct lu_ent *ent, const char *attribute);
id_t lu_ent_get_first_id(struct lu_ent *ent, const char *attribute);
gboolean lu_ent_has(struct lu_ent *ent, const char *attribute);
void lu_ent_set(struct lu_ent *ent, const char *attr,
const GValueArray *values);
void lu_ent_set_string(struct lu_ent *ent, const char *attr, const char *value);
void lu_ent_set_id(struct lu_ent *ent, const char *attr, id_t value);
void lu_ent_set_long(struct lu_ent *ent, const char *attr, long int value);
void lu_ent_add(struct lu_ent *ent, const char *attr,
const GValue *value);
void lu_ent_clear(struct lu_ent *ent, const char *attr);
void lu_ent_clear_all(struct lu_ent *ent);
void lu_ent_del(struct lu_ent *ent, const char *attr, const GValue *value);
GList *lu_ent_get_attributes(struct lu_ent *ent);
void lu_ent_dump(struct lu_ent *ent, FILE *fp);
G_END_DECLS
#endif
|