| entity.h | | entity.h | |
| | | | |
| skipping to change at line 65 | | skipping to change at line 65 | |
| * LU_USERNAME: | | * LU_USERNAME: | |
| * | | * | |
| * User name, a %G_TYPE_STRING. | | * User name, a %G_TYPE_STRING. | |
| */ | | */ | |
| #define LU_USERNAME "pw_name" | | #define LU_USERNAME "pw_name" | |
| /** | | /** | |
| * LU_USERPASSWORD: | | * LU_USERPASSWORD: | |
| * | | * | |
| * User password, a %G_TYPE_STRING. If shadow passwords are used, this is
the | | * User password, a %G_TYPE_STRING. If shadow passwords are used, this is
the | |
| * placeholder password. | | * placeholder password. | |
|
| | | * | |
| | | * Don't modify passwords by changing this attribute directly, use one of t | |
| | | he | |
| | | * specialized functions. | |
| */ | | */ | |
| #define LU_USERPASSWORD "pw_passwd" | | #define LU_USERPASSWORD "pw_passwd" | |
| /** | | /** | |
| * LU_UIDNUMBER: | | * LU_UIDNUMBER: | |
| * | | * | |
| * User ID, an #id_t. | | * User ID, an #id_t. | |
| */ | | */ | |
| #define LU_UIDNUMBER "pw_uid" | | #define LU_UIDNUMBER "pw_uid" | |
| /** | | /** | |
| * LU_GIDNUMBER: | | * LU_GIDNUMBER: | |
| | | | |
| skipping to change at line 110 | | skipping to change at line 113 | |
| /** | | /** | |
| * LU_GROUPNAME: | | * LU_GROUPNAME: | |
| * | | * | |
| * Group name, a %G_TYPE_STRING. | | * Group name, a %G_TYPE_STRING. | |
| */ | | */ | |
| #define LU_GROUPNAME "gr_name" | | #define LU_GROUPNAME "gr_name" | |
| /** | | /** | |
| * LU_GROUPPASSWORD: | | * LU_GROUPPASSWORD: | |
| * | | * | |
| * Group password, a %G_TYPE_STRING. | | * Group password, a %G_TYPE_STRING. | |
|
| | | * | |
| | | * Don't modify passwords by changing this attribute directly, use one of t | |
| | | he | |
| | | * specialized functions. | |
| */ | | */ | |
| #define LU_GROUPPASSWORD "gr_passwd" | | #define LU_GROUPPASSWORD "gr_passwd" | |
| /* #define LU_GIDNUMBER "gr_gid" */ | | /* #define LU_GIDNUMBER "gr_gid" */ | |
| /** | | /** | |
| * LU_MEMBERNAME: | | * LU_MEMBERNAME: | |
| * | | * | |
| * Group member names; each member is represented by a separate %G_TYPE_STR
ING | | * Group member names; each member is represented by a separate %G_TYPE_STR
ING | |
| * value. | | * value. | |
| */ | | */ | |
| #define LU_MEMBERNAME "gr_mem" | | #define LU_MEMBERNAME "gr_mem" | |
| | | | |
| skipping to change at line 140 | | skipping to change at line 146 | |
| * LU_SHADOWNAME: | | * LU_SHADOWNAME: | |
| * | | * | |
| * User name, a %G_TYPE_STRING. Note that %LU_SHADOWNAME is not distinct f
rom | | * User name, a %G_TYPE_STRING. Note that %LU_SHADOWNAME is not distinct f
rom | |
| * %LU_USERNAME. | | * %LU_USERNAME. | |
| */ | | */ | |
| #define LU_SHADOWNAME LU_USERNAME | | #define LU_SHADOWNAME LU_USERNAME | |
| /** | | /** | |
| * LU_SHADOWPASSWORD: | | * LU_SHADOWPASSWORD: | |
| * | | * | |
| * User password in the shadow file, a %G_TYPE_STRING. | | * User password in the shadow file, a %G_TYPE_STRING. | |
|
| | | * | |
| | | * Don't modify passwords by changing this attribute directly, use one of t | |
| | | he | |
| | | * specialized functions. | |
| */ | | */ | |
| #define LU_SHADOWPASSWORD "sp_pwdp" | | #define LU_SHADOWPASSWORD "sp_pwdp" | |
| /** | | /** | |
| * LU_SHADOWLASTCHANGE: | | * LU_SHADOWLASTCHANGE: | |
| * | | * | |
| * The number of days since the epoch to the day when the password was last | | * The number of days since the epoch to the day when the password was last | |
| * changed, a %G_TYPE_LONG. | | * changed, a %G_TYPE_LONG. | |
| */ | | */ | |
| #define LU_SHADOWLASTCHANGE "sp_lstchg" | | #define LU_SHADOWLASTCHANGE "sp_lstchg" | |
| /** | | /** | |
| | | | |
| skipping to change at line 245 | | skipping to change at line 254 | |
| | | | |
| struct lu_ent *lu_ent_new(void); | | struct lu_ent *lu_ent_new(void); | |
| void lu_ent_free(struct lu_ent *ent); | | void lu_ent_free(struct lu_ent *ent); | |
| | | | |
| void lu_ent_copy(struct lu_ent *source, struct lu_ent *dest); | | void lu_ent_copy(struct lu_ent *source, struct lu_ent *dest); | |
| | | | |
| void lu_ent_revert(struct lu_ent *ent); | | void lu_ent_revert(struct lu_ent *ent); | |
| void lu_ent_commit(struct lu_ent *ent); | | void lu_ent_commit(struct lu_ent *ent); | |
| | | | |
| GValueArray *lu_ent_get_current(struct lu_ent *ent, const char *attribute); | | 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); | | gboolean lu_ent_has_current(struct lu_ent *ent, const char *attribute); | |
| void lu_ent_set_current(struct lu_ent *ent, const char *attr, | | void lu_ent_set_current(struct lu_ent *ent, const char *attr, | |
| const GValueArray *values); | | 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, | | void lu_ent_add_current(struct lu_ent *ent, const char *attr, | |
| const GValue *value); | | const GValue *value); | |
| void lu_ent_clear_current(struct lu_ent *ent, const char *attr); | | 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_clear_all_current(struct lu_ent *ent); | |
| void lu_ent_del_current(struct lu_ent *ent, const char *attr, | | void lu_ent_del_current(struct lu_ent *ent, const char *attr, | |
| const GValue *value); | | const GValue *value); | |
| GList *lu_ent_get_attributes_current(struct lu_ent *ent); | | GList *lu_ent_get_attributes_current(struct lu_ent *ent); | |
| | | | |
| GValueArray *lu_ent_get(struct lu_ent *ent, const char *attribute); | | GValueArray *lu_ent_get(struct lu_ent *ent, const char *attribute); | |
|
| | | const char *lu_ent_get_first_string(struct lu_ent *ent, const char *attribu | |
| | | te); | |
| | | char *lu_ent_get_first_value_strdup(struct lu_ent *ent, const char *attribu | |
| | | te); | |
| | | 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); | | gboolean lu_ent_has(struct lu_ent *ent, const char *attribute); | |
| void lu_ent_set(struct lu_ent *ent, const char *attr, | | void lu_ent_set(struct lu_ent *ent, const char *attr, | |
| const GValueArray *values); | | const GValueArray *values); | |
|
| | | void lu_ent_set_string(struct lu_ent *ent, const char *attr, const char *va | |
| | | lue); | |
| | | 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, | | void lu_ent_add(struct lu_ent *ent, const char *attr, | |
| const GValue *value); | | const GValue *value); | |
| void lu_ent_clear(struct lu_ent *ent, const char *attr); | | void lu_ent_clear(struct lu_ent *ent, const char *attr); | |
| void lu_ent_clear_all(struct lu_ent *ent); | | void lu_ent_clear_all(struct lu_ent *ent); | |
| void lu_ent_del(struct lu_ent *ent, const char *attr, const GValue *value); | | void lu_ent_del(struct lu_ent *ent, const char *attr, const GValue *value); | |
| GList *lu_ent_get_attributes(struct lu_ent *ent); | | GList *lu_ent_get_attributes(struct lu_ent *ent); | |
| | | | |
| void lu_ent_dump(struct lu_ent *ent, FILE *fp); | | void lu_ent_dump(struct lu_ent *ent, FILE *fp); | |
| | | | |
| G_END_DECLS | | G_END_DECLS | |
| | | | |
End of changes. 7 change blocks. |
| 0 lines changed or deleted | | 33 lines changed or added | |
|
| user_private.h | | user_private.h | |
| | | | |
| skipping to change at line 42 | | skipping to change at line 42 | |
| #include <libintl.h> | | #include <libintl.h> | |
| #include <locale.h> | | #include <locale.h> | |
| #ifdef WITH_SELINUX | | #ifdef WITH_SELINUX | |
| #include <selinux/selinux.h> | | #include <selinux/selinux.h> | |
| #endif | | #endif | |
| #include "user.h" | | #include "user.h" | |
| | | | |
| G_BEGIN_DECLS | | G_BEGIN_DECLS | |
| | | | |
| #define LU_ENT_MAGIC 0x00000006 | | #define LU_ENT_MAGIC 0x00000006 | |
|
| #define LU_MODULE_VERSION 0x000d0000 | | #define LU_MODULE_VERSION 0x000e0000 | |
| #define _(String) dgettext(PACKAGE_NAME, String) | | #define _(String) dgettext(PACKAGE_NAME, String) | |
| #define N_(String) String | | #define N_(String) String | |
| /* A crypt hash is at least 64 bits of data, encoded 6 bits per printable | | /* A crypt hash is at least 64 bits of data, encoded 6 bits per printable | |
| * character, and we assume that all crypt algorithms generate strings at | | * character, and we assume that all crypt algorithms generate strings at | |
| * least this long. */ | | * least this long. */ | |
| #define LU_CRYPTED "{CRYPT}" | | #define LU_CRYPTED "{CRYPT}" | |
| #define LU_CRYPT_SIZE howmany(64,6) | | #define LU_CRYPT_SIZE howmany(64,6) | |
| #define LU_CRYPT_INVALID(String) \ | | #define LU_CRYPT_INVALID(String) \ | |
| ((strlen(String) > 0) && \ | | ((strlen(String) > 0) && \ | |
| (String[0] != '!') && \ | | (String[0] != '!') && \ | |
| | | | |
| skipping to change at line 206 | | skipping to change at line 206 | |
| GValueArray* (*users_enumerate) (struct lu_module * module, | | GValueArray* (*users_enumerate) (struct lu_module * module, | |
| const char *pattern, | | const char *pattern, | |
| struct lu_error ** error); | | struct lu_error ** error); | |
| GValueArray* (*users_enumerate_by_group) (struct lu_module * module, | | GValueArray* (*users_enumerate_by_group) (struct lu_module * module, | |
| const char *group, | | const char *group, | |
| gid_t gid, | | gid_t gid, | |
| struct lu_error ** error); | | struct lu_error ** error); | |
| GPtrArray* (*users_enumerate_full) (struct lu_module * module, | | GPtrArray* (*users_enumerate_full) (struct lu_module * module, | |
| const char *pattern, | | const char *pattern, | |
| struct lu_error ** error); | | struct lu_error ** error); | |
|
| /* Placeholder. Can't come up with a reason to have it other than | | | |
| * symmetry. */ | | | |
| GPtrArray* (*users_enumerate_by_group_full) (struct lu_module * modu | | | |
| le, | | | |
| const char *group, | | | |
| gid_t gid, | | | |
| struct lu_error ** erro | | | |
| r); | | | |
| /* Search for a group by name or ID. */ | | /* Search for a group by name or ID. */ | |
| gboolean(*group_lookup_name) (struct lu_module * module, | | gboolean(*group_lookup_name) (struct lu_module * module, | |
| const char *name, | | const char *name, | |
| struct lu_ent * ent, | | struct lu_ent * ent, | |
| struct lu_error ** error); | | struct lu_error ** error); | |
| gboolean(*group_lookup_id) (struct lu_module * module, | | gboolean(*group_lookup_id) (struct lu_module * module, | |
| gid_t gid, | | gid_t gid, | |
| struct lu_ent * ent, | | struct lu_ent * ent, | |
| struct lu_error ** error); | | struct lu_error ** error); | |
| /* Populate a group with sensible defaults. */ | | /* Populate a group with sensible defaults. */ | |
| | | | |
| skipping to change at line 277 | | skipping to change at line 271 | |
| GValueArray* (*groups_enumerate) (struct lu_module * module, | | GValueArray* (*groups_enumerate) (struct lu_module * module, | |
| const char *pattern, | | const char *pattern, | |
| struct lu_error ** error); | | struct lu_error ** error); | |
| GValueArray* (*groups_enumerate_by_user) (struct lu_module * module, | | GValueArray* (*groups_enumerate_by_user) (struct lu_module * module, | |
| const char *user, | | const char *user, | |
| uid_t uid, | | uid_t uid, | |
| struct lu_error ** error); | | struct lu_error ** error); | |
| GPtrArray* (*groups_enumerate_full) (struct lu_module * module, | | GPtrArray* (*groups_enumerate_full) (struct lu_module * module, | |
| const char *pattern, | | const char *pattern, | |
| struct lu_error ** error); | | struct lu_error ** error); | |
|
| /* Placeholder. Can't come up with a reason to have it. */ | | | |
| GPtrArray* (*groups_enumerate_by_user_full) (struct lu_module * modu | | | |
| le, | | | |
| const char *user, | | | |
| uid_t uid, | | | |
| struct lu_error ** erro | | | |
| r); | | | |
| | | | |
| /* Clean up any data this module has, and unload it. */ | | /* Clean up any data this module has, and unload it. */ | |
| gboolean(*close) (struct lu_module * module); | | gboolean(*close) (struct lu_module * module); | |
| }; | | }; | |
| | | | |
| /* The type of the initialization function a module exports for the library | | /* The type of the initialization function a module exports for the library | |
| * to use when initializing it. Should fit "lu_%s_init", where the string | | * to use when initializing it. Should fit "lu_%s_init", where the string | |
| * is the name of the module being loaded (and this should match the "name" | | * is the name of the module being loaded (and this should match the "name" | |
| * attribute of the module structure). */ | | * attribute of the module structure). */ | |
| #define LU_MODULE_INIT(_fn) extern struct lu_module *\ | | #define LU_MODULE_INIT(_fn) extern struct lu_module *\ | |
| | | | |
| skipping to change at line 359 | | skipping to change at line 348 | |
| struct lu_error **error); | | struct lu_error **error); | |
| gboolean lu_util_field_write(int fd, const char *first, unsigned int field, | | gboolean lu_util_field_write(int fd, const char *first, unsigned int field, | |
| const char *value, struct lu_error **error); | | const char *value, struct lu_error **error); | |
| | | | |
| void lu_util_update_shadow_last_change(struct lu_ent *ent); | | void lu_util_update_shadow_last_change(struct lu_ent *ent); | |
| | | | |
| /* Find the first unused ID of the given type, searching starting at "id".
*/ | | /* Find the first unused ID of the given type, searching starting at "id".
*/ | |
| id_t lu_get_first_unused_id(struct lu_context *ctx, enum lu_entity_type typ
e, | | id_t lu_get_first_unused_id(struct lu_context *ctx, enum lu_entity_type typ
e, | |
| id_t id); | | id_t id); | |
| | | | |
|
| | | /* Append a copy of VALUES to DEST */ | |
| | | void lu_util_append_values(GValueArray *dest, GValueArray *values); | |
| | | | |
| G_END_DECLS | | G_END_DECLS | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 4 change blocks. |
| 16 lines changed or deleted | | 4 lines changed or added | |
|