| entity.h | | entity.h | |
| | | | |
| skipping to change at line 29 | | skipping to change at line 29 | |
| #ifndef libuser_entity_h | | #ifndef libuser_entity_h | |
| #define libuser_entity_h | | #define libuser_entity_h | |
| | | | |
| #include <sys/types.h> | | #include <sys/types.h> | |
| #include <stdio.h> | | #include <stdio.h> | |
| #include <glib.h> | | #include <glib.h> | |
| #include <glib-object.h> | | #include <glib-object.h> | |
| | | | |
| G_BEGIN_DECLS | | G_BEGIN_DECLS | |
| | | | |
|
| /* Opaque data type. */ | | /** | |
| | | * 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 a | |
| | | re | |
| | | * modified by functions ending with _current. | |
| | | * | |
| | | * Each attribute contains a list of values. The list is never empty; remo | |
| | | ving | |
| | | * 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; | | typedef struct lu_ent lu_ent_t; | |
|
| | | #endif | |
| | | | |
| /* Attributes carried by all user structures. */ | | /* Attributes carried by all user structures. */ | |
|
| | | /** | |
| | | * LU_USERNAME: | |
| | | * | |
| | | * User name, a %G_TYPE_STRING. | |
| | | */ | |
| #define LU_USERNAME "pw_name" | | #define LU_USERNAME "pw_name" | |
|
| | | /** | |
| | | * LU_USERPASSWORD: | |
| | | * | |
| | | * User password, a %G_TYPE_STRING. If shadow passwords are used, this is | |
| | | the | |
| | | * placeholder password. | |
| | | */ | |
| #define LU_USERPASSWORD "pw_passwd" | | #define LU_USERPASSWORD "pw_passwd" | |
|
| | | /** | |
| | | * LU_UIDNUMBER: | |
| | | * | |
| | | * User ID, an #id_t. | |
| | | */ | |
| #define LU_UIDNUMBER "pw_uid" | | #define LU_UIDNUMBER "pw_uid" | |
|
| | | /** | |
| | | * LU_GIDNUMBER: | |
| | | * | |
| | | * Group ID, an #id_t. | |
| | | */ | |
| #define LU_GIDNUMBER "pw_gid" | | #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" | | #define LU_GECOS "pw_gecos" | |
|
| | | /** | |
| | | * LU_HOMEDIRECTORY: | |
| | | * | |
| | | * User's home directory, a %G_TYPE_STRING. | |
| | | */ | |
| #define LU_HOMEDIRECTORY "pw_dir" | | #define LU_HOMEDIRECTORY "pw_dir" | |
|
| | | /** | |
| | | * LU_LOGINSHELL: | |
| | | * | |
| | | * User's login shell, a %G_TYPE_STRING. | |
| | | */ | |
| #define LU_LOGINSHELL "pw_shell" | | #define LU_LOGINSHELL "pw_shell" | |
| | | | |
| /* Attributes carried by group structures. */ | | /* Attributes carried by group structures. */ | |
|
| | | /** | |
| | | * LU_GROUPNAME: | |
| | | * | |
| | | * Group name, a %G_TYPE_STRING. | |
| | | */ | |
| #define LU_GROUPNAME "gr_name" | | #define LU_GROUPNAME "gr_name" | |
|
| | | /** | |
| | | * LU_GROUPPASSWORD: | |
| | | * | |
| | | * Group password, a %G_TYPE_STRING. | |
| | | */ | |
| #define LU_GROUPPASSWORD "gr_passwd" | | #define LU_GROUPPASSWORD "gr_passwd" | |
| /* #define LU_GIDNUMBER "gr_gid" */ | | /* #define LU_GIDNUMBER "gr_gid" */ | |
|
| | | /** | |
| | | * LU_MEMBERNAME: | |
| | | * | |
| | | * Group member names; each member is represented by a separate %G_TYPE_STR | |
| | | ING | |
| | | * value. | |
| | | */ | |
| #define LU_MEMBERNAME "gr_mem" | | #define LU_MEMBERNAME "gr_mem" | |
|
| | | /** | |
| | | * LU_ADMINISTRATORNAME: | |
| | | * | |
| | | * Group administrator names; each administrator is represented by a separa | |
| | | te | |
| | | * %G_TYPE_STRING value. | |
| | | */ | |
| #define LU_ADMINISTRATORNAME "gr_adm" | | #define LU_ADMINISTRATORNAME "gr_adm" | |
| | | | |
| /* Attributes carried by shadow user structures. */ | | /* Attributes carried by shadow user structures. */ | |
|
| | | /** | |
| | | * LU_SHADOWNAME: | |
| | | * | |
| | | * User name, a %G_TYPE_STRING. Note that %LU_SHADOWNAME is not distinct f | |
| | | rom | |
| | | * %LU_USERNAME. | |
| | | */ | |
| #define LU_SHADOWNAME LU_USERNAME | | #define LU_SHADOWNAME LU_USERNAME | |
|
| | | /** | |
| | | * LU_SHADOWPASSWORD: | |
| | | * | |
| | | * User password in the shadow file, a %G_TYPE_STRING. | |
| | | */ | |
| #define LU_SHADOWPASSWORD "sp_pwdp" | | #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. | |
| | | */ | |
| #define LU_SHADOWLASTCHANGE "sp_lstchg" | | #define LU_SHADOWLASTCHANGE "sp_lstchg" | |
|
| | | /** | |
| | | * LU_SHADOWMIN: | |
| | | * | |
| | | * Minimum password lifetime in days before it can be changed, a %G_TYPE_LO | |
| | | NG. | |
| | | */ | |
| #define LU_SHADOWMIN "sp_min" | | #define LU_SHADOWMIN "sp_min" | |
|
| | | /** | |
| | | * LU_SHADOWMAX: | |
| | | * | |
| | | * Maximum password lifetime in days before it must be changed, a %G_TYPE_L | |
| | | ONG. | |
| | | */ | |
| #define LU_SHADOWMAX "sp_max" | | #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. | |
| | | */ | |
| #define LU_SHADOWWARNING "sp_warn" | | #define LU_SHADOWWARNING "sp_warn" | |
|
| | | /** | |
| | | * LU_SHADOWINACTIVE: | |
| | | * | |
| | | * Days after the password lifetime expires when the user account is disabl | |
| | | ed | |
| | | * (because it is considered inactive), a %G_TYPE_LONG. -1 to disable inac | |
| | | tive | |
| | | * account disabling. | |
| | | */ | |
| #define LU_SHADOWINACTIVE "sp_inact" | | #define LU_SHADOWINACTIVE "sp_inact" | |
|
| | | /** | |
| | | * LU_SHADOWEXPIRE: | |
| | | * | |
| | | * The number of days since the epoch to the day when the account expires a | |
| | | nd | |
| | | * is disabled, a %G_TYPE_LONG. -1 to disable account expiration. | |
| | | */ | |
| #define LU_SHADOWEXPIRE "sp_expire" | | #define LU_SHADOWEXPIRE "sp_expire" | |
|
| | | /** | |
| | | * LU_SHADOWFLAG: | |
| | | * | |
| | | * A reserved value "for future use", a %G_TYPE_LONG. In most cases the va | |
| | | lue | |
| | | * is -1. | |
| | | */ | |
| #define LU_SHADOWFLAG "sp_flag" | | #define LU_SHADOWFLAG "sp_flag" | |
| | | | |
| /* Additional fields carried by some structures. If they have them, | | /* Additional fields carried by some structures. If they have them, | |
| * it's safe to change them. */ | | * it's safe to change them. */ | |
|
| | | /** | |
| | | * LU_COMMONNAME: | |
| | | * | |
| | | * User's real name, a %G_TYPE_STRING. | |
| | | */ | |
| #define LU_COMMONNAME "cn" | | #define LU_COMMONNAME "cn" | |
|
| | | /** | |
| | | * LU_GIVENNAME: | |
| | | * | |
| | | * User's given name, a %G_TYPE_STRING. | |
| | | */ | |
| #define LU_GIVENNAME "givenName" | | #define LU_GIVENNAME "givenName" | |
|
| | | /** | |
| | | * LU_SN: | |
| | | * | |
| | | * User's surname, a %G_TYPE_STRING. | |
| | | */ | |
| #define LU_SN "sn" | | #define LU_SN "sn" | |
|
| | | /** | |
| | | * LU_ROOMNUMBER: | |
| | | * | |
| | | * User's room number, a %G_TYPE_STRING. | |
| | | */ | |
| #define LU_ROOMNUMBER "roomNumber" | | #define LU_ROOMNUMBER "roomNumber" | |
|
| | | /** | |
| | | * LU_TELEPHONENUMBER: | |
| | | * | |
| | | * User's telephone number, a %G_TYPE_STRING. | |
| | | */ | |
| #define LU_TELEPHONENUMBER "telephoneNumber" | | #define LU_TELEPHONENUMBER "telephoneNumber" | |
|
| | | /** | |
| | | * LU_HOMEPHONE: | |
| | | * | |
| | | * User's home telephone number, a %G_TYPE_STRING. | |
| | | */ | |
| #define LU_HOMEPHONE "homePhone" | | #define LU_HOMEPHONE "homePhone" | |
|
| | | /** | |
| | | * LU_EMAIL: | |
| | | * | |
| | | * User's email address, a %G_TYPE_STRING. | |
| | | */ | |
| #define LU_EMAIL "mail" | | #define LU_EMAIL "mail" | |
| | | | |
|
| /* Function to allocate a new entity structure, or destroy one. */ | | struct lu_ent *lu_ent_new(void); | |
| lu_ent_t *lu_ent_new(void); | | void lu_ent_free(struct lu_ent *ent); | |
| void lu_ent_free(lu_ent_t *ent); | | | |
| | | | |
| /* Deep-copy the contents of one entity structure into another. */ | | | |
| void lu_ent_copy(lu_ent_t *source, lu_ent_t *dest); | | | |
| | | | |
|
| /* Entity structures have a limited form of version-control, and that gives | | void lu_ent_copy(struct lu_ent *source, struct lu_ent *dest); | |
| * us the ability to roll back changes. */ | | | |
| void lu_ent_revert(lu_ent_t *ent); | | | |
| | | | |
|
| /* This function rolls changes forward. */ | | void lu_ent_revert(struct lu_ent *ent); | |
| void lu_ent_commit(lu_ent_t *ent); | | void lu_ent_commit(struct lu_ent *ent); | |
| | | | |
|
| /* These functions are used to set and query "current" data attributes, the | | GValueArray *lu_ent_get_current(struct lu_ent *ent, const char *attribute); | |
| * values the library itself usually sets. */ | | gboolean lu_ent_has_current(struct lu_ent *ent, const char *attribute); | |
| GValueArray *lu_ent_get_current(lu_ent_t *ent, const char *attribute); | | void lu_ent_set_current(struct lu_ent *ent, const char *attr, | |
| gboolean lu_ent_has_current(lu_ent_t *ent, const char *attribute); | | | |
| void lu_ent_set_current(lu_ent_t *ent, const char *attr, | | | |
| const GValueArray *values); | | const GValueArray *values); | |
|
| void lu_ent_add_current(lu_ent_t *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(lu_ent_t *ent, const char *attr); | | void lu_ent_clear_current(struct lu_ent *ent, const char *attr); | |
| void lu_ent_clear_all_current(lu_ent_t *ent); | | void lu_ent_clear_all_current(struct lu_ent *ent); | |
| void lu_ent_del_current(lu_ent_t *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(lu_ent_t *ent); | | GList *lu_ent_get_attributes_current(struct lu_ent *ent); | |
| | | | |
|
| /* These functions are used to set and query "pending" data attributes, whi | | GValueArray *lu_ent_get(struct lu_ent *ent, const char *attribute); | |
| ch | | gboolean lu_ent_has(struct lu_ent *ent, const char *attribute); | |
| * will take effect when we write this entry back out. */ | | void lu_ent_set(struct lu_ent *ent, const char *attr, | |
| GValueArray *lu_ent_get(lu_ent_t *ent, const char *attribute); | | | |
| gboolean lu_ent_has(lu_ent_t *ent, const char *attribute); | | | |
| void lu_ent_set(lu_ent_t *ent, const char *attr, | | | |
| const GValueArray *values); | | const GValueArray *values); | |
|
| void lu_ent_add(lu_ent_t *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(lu_ent_t *ent, const char *attr); | | void lu_ent_clear(struct lu_ent *ent, const char *attr); | |
| void lu_ent_clear_all(lu_ent_t *ent); | | void lu_ent_clear_all(struct lu_ent *ent); | |
| void lu_ent_del(lu_ent_t *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(lu_ent_t *ent); | | GList *lu_ent_get_attributes(struct lu_ent *ent); | |
| | | | |
|
| void lu_ent_dump(lu_ent_t *ent, FILE *fp); | | void lu_ent_dump(struct lu_ent *ent, FILE *fp); | |
| | | | |
| G_END_DECLS | | G_END_DECLS | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 40 change blocks. |
| 34 lines changed or deleted | | 204 lines changed or added | |
|
| error.h | | error.h | |
| | | | |
| skipping to change at line 28 | | skipping to change at line 28 | |
| | | | |
| #ifndef libuser_error_h | | #ifndef libuser_error_h | |
| #define libuser_error_h | | #define libuser_error_h | |
| | | | |
| #include <sys/types.h> | | #include <sys/types.h> | |
| #include <errno.h> | | #include <errno.h> | |
| #include <glib.h> | | #include <glib.h> | |
| | | | |
| G_BEGIN_DECLS | | G_BEGIN_DECLS | |
| | | | |
|
| typedef enum lu_status { | | enum lu_status { | |
| /* Non-fatal. */ | | /* Non-fatal. */ | |
| lu_success = 0, | | lu_success = 0, | |
| lu_warning_config_disabled, | | lu_warning_config_disabled, | |
| | | | |
| /* Fatal. */ | | /* Fatal. */ | |
| lu_error_generic, | | lu_error_generic, | |
| lu_error_privilege, | | lu_error_privilege, | |
| lu_error_access_denied, | | lu_error_access_denied, | |
| | | | |
| /* Data validation errors. */ | | /* Data validation errors. */ | |
| | | | |
| skipping to change at line 69 | | skipping to change at line 69 | |
| lu_error_module_version, | | lu_error_module_version, | |
| | | | |
| /* Since 0.53 */ | | /* Since 0.53 */ | |
| lu_error_unlock_empty, | | lu_error_unlock_empty, | |
| | | | |
| /* Since 0.56 */ | | /* Since 0.56 */ | |
| lu_error_invalid_attribute_value, | | lu_error_invalid_attribute_value, | |
| | | | |
| /* Since 0.57 */ | | /* Since 0.57 */ | |
| lu_error_invalid_module_combination, | | lu_error_invalid_module_combination, | |
|
| } lu_status_t; | | }; | |
| | | #ifndef __GTK_DOC_IGNORE__ | |
| | | #ifndef LU_DISABLE_DEPRECATED | |
| | | typedef enum lu_status lu_status_t; | |
| | | #endif | |
| | | #endif | |
| | | | |
|
| typedef struct lu_error { | | /** | |
| | | * lu_error: | |
| | | * | |
| | | * Error and status information. | |
| | | */ | |
| | | /* gtk-doc is dumb. */ | |
| | | struct lu_error; | |
| | | struct lu_error { | |
| enum lu_status code; | | enum lu_status code; | |
| char *string; | | char *string; | |
|
| } lu_error_t; | | }; | |
| | | #ifndef LU_DISABLE_DEPRECATED | |
| | | /** | |
| | | * lu_error_t: | |
| | | * | |
| | | * An alias for struct #lu_error. | |
| | | * Deprecated: 0.57.3: Use struct #lu_error directly. | |
| | | */ | |
| | | typedef struct lu_error lu_error_t; | |
| | | #endif | |
| | | | |
|
| /* Checks that a passed-in error pointer is not already populated, and call | | /** | |
| s | | * LU_ERROR_CHECK: | |
| abort() if it is. */ | | * @err_p_p: A pointer to a struct #lu_error * which will be checked. | |
| | | * | |
| | | * Checks that the given pointer to a pointer to a struct does not already | |
| | | * point to a valid #lu_error structure, and calls abort() on failure. Thi | |
| | | s | |
| | | * macro is used by many internal functions to check that an error has not | |
| | | * already occurred when they are invoked. | |
| | | */ | |
| #define LU_ERROR_CHECK(err_p_p) \ | | #define LU_ERROR_CHECK(err_p_p) \ | |
| do { \ | | do { \ | |
| struct lu_error **__err = (err_p_p); \ | | struct lu_error **__err = (err_p_p); \ | |
| if ((__err == NULL) || (*__err != NULL)) { \ | | if ((__err == NULL) || (*__err != NULL)) { \ | |
| if(__err == NULL) { \ | | if(__err == NULL) { \ | |
| fprintf(stderr, "libuser fatal error: %s() called wi
th NULL " #err_p_p "\n", __FUNCTION__); \ | | fprintf(stderr, "libuser fatal error: %s() called wi
th NULL " #err_p_p "\n", __FUNCTION__); \ | |
| } else \ | | } else \ | |
| if(*__err != NULL) { \ | | if(*__err != NULL) { \ | |
| fprintf(stderr, "libuser fatal error: %s() called wi
th non-NULL *" #err_p_p "\n", __FUNCTION__); \ | | fprintf(stderr, "libuser fatal error: %s() called wi
th non-NULL *" #err_p_p "\n", __FUNCTION__); \ | |
| } \ | | } \ | |
| abort(); \ | | abort(); \ | |
| } \ | | } \ | |
| } while(0) | | } while(0) | |
| | | | |
|
| /* Functions for allocating and freeing error objects. */ | | void lu_error_new(struct lu_error **error, enum lu_status code, | |
| void lu_error_new(lu_error_t **error, lu_status_t code, | | | |
| const char *fmt, ...) G_GNUC_PRINTF(3, 4); | | const char *fmt, ...) G_GNUC_PRINTF(3, 4); | |
|
| const char *lu_strerror(lu_error_t *error); | | const char *lu_strerror(struct lu_error *error); | |
| gboolean lu_error_is_success(lu_status_t status); | | gboolean lu_error_is_success(enum lu_status status); | |
| gboolean lu_error_is_warning(lu_status_t status); | | gboolean lu_error_is_warning(enum lu_status status); | |
| gboolean lu_error_is_error(lu_status_t status); | | gboolean lu_error_is_error(enum lu_status status); | |
| void lu_error_free(lu_error_t **error); | | void lu_error_free(struct lu_error **error); | |
| | | | |
| G_END_DECLS | | G_END_DECLS | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 7 change blocks. |
| 14 lines changed or deleted | | 41 lines changed or added | |
|
| user.h | | user.h | |
| | | | |
| skipping to change at line 31 | | skipping to change at line 31 | |
| | | | |
| #include <sys/types.h> | | #include <sys/types.h> | |
| #include <glib.h> | | #include <glib.h> | |
| #include "config.h" | | #include "config.h" | |
| #include "entity.h" | | #include "entity.h" | |
| #include "error.h" | | #include "error.h" | |
| #include "prompt.h" | | #include "prompt.h" | |
| | | | |
| G_BEGIN_DECLS | | G_BEGIN_DECLS | |
| | | | |
|
| | | /** | |
| | | * LU_VALUE_INVALID_ID: | |
| | | * | |
| | | * An #id_t value that matches no valid user or group ID. | |
| | | */ | |
| /* (id_t)-1 is used by setreuid() to indicate "not a valid ID", so it shoul
d be | | /* (id_t)-1 is used by setreuid() to indicate "not a valid ID", so it shoul
d be | |
| safe to use for error indication. */ | | safe to use for error indication. */ | |
| #define LU_VALUE_INVALID_ID ((id_t)-1) | | #define LU_VALUE_INVALID_ID ((id_t)-1) | |
| | | | |
|
| /* An opaque structure manipulated by the library. */ | | /** | |
| | | * lu_context: | |
| | | * | |
| | | * An opaque structure manipulated by the library, containing caller-relate | |
| | | d | |
| | | * state (to allow several independent callers in a single process). | |
| | | */ | |
| | | struct lu_context; | |
| | | #ifndef LU_DISABLE_DEPRECATED | |
| | | /** | |
| | | * lu_context_t: | |
| | | * | |
| | | * An alias for struct #lu_context. | |
| | | * Deprecated: 0.57.3: Use struct #lu_context directly. | |
| | | */ | |
| typedef struct lu_context lu_context_t; | | typedef struct lu_context lu_context_t; | |
|
| | | #endif | |
| | | | |
| /* An enumeration which decides whether we want to modify information about | | /* An enumeration which decides whether we want to modify information about | |
| * users or groups. We don't support both simultaneously. */ | | * users or groups. We don't support both simultaneously. */ | |
|
| typedef enum lu_entity_type { lu_invalid, lu_user, lu_group } lu_entity_typ | | enum lu_entity_type { | |
| e_t; | | lu_invalid, | |
| | | lu_user, | |
| | | lu_group, | |
| | | }; | |
| | | #ifndef __GTK_DOC_IGNORE__ | |
| | | #ifndef LU_DISABLE_DEPRECATED | |
| | | typedef enum lu_entity_type lu_entity_type_t; | |
| | | #endif | |
| | | #endif | |
| | | | |
| char *lu_value_strdup(const GValue *value); | | char *lu_value_strdup(const GValue *value); | |
| int lu_values_equal(const GValue *a, const GValue *b); | | int lu_values_equal(const GValue *a, const GValue *b); | |
| void lu_value_init_set_id(GValue *value, id_t id); | | void lu_value_init_set_id(GValue *value, id_t id); | |
| id_t lu_value_get_id(const GValue *value); | | id_t lu_value_get_id(const GValue *value); | |
| gboolean lu_value_init_set_attr_from_string(GValue *value, const char *attr
, | | gboolean lu_value_init_set_attr_from_string(GValue *value, const char *attr
, | |
| const char *string, | | const char *string, | |
|
| lu_error_t **error); | | struct lu_error **error); | |
| | | | |
|
| lu_context_t *lu_start(const char *authname, | | struct lu_context *lu_start(const char *authname, enum lu_entity_type auth_ | |
| lu_entity_type_t auth_type, | | type, | |
| const char *modules, const char *create_modules, | | const char *modules, const char *create_modules, | |
| lu_prompt_fn *prompter, | | lu_prompt_fn *prompter, gpointer callback_data, | |
| gpointer callback_data, | | struct lu_error **error); | |
| lu_error_t **error); | | void lu_end(struct lu_context *context); | |
| void lu_end(lu_context_t *context); | | | |
| | | | |
|
| void lu_set_prompter(lu_context_t *context, | | void lu_set_prompter(struct lu_context *context, | |
| lu_prompt_fn *prompter, gpointer callback_data); | | lu_prompt_fn *prompter, gpointer callback_data); | |
|
| void lu_get_prompter(lu_context_t *context, | | void lu_get_prompter(struct lu_context *context, | |
| lu_prompt_fn ** prompter, gpointer *callback_data); | | lu_prompt_fn ** prompter, gpointer *callback_data); | |
| | | | |
|
| gboolean lu_set_modules(lu_context_t *context, | | gboolean lu_set_modules(struct lu_context *context, | |
| const char *list, lu_error_t **error); | | const char *list, struct lu_error **error); | |
| const char *lu_get_modules(lu_context_t *context); | | const char *lu_get_modules(struct lu_context *context); | |
| gboolean lu_uses_elevated_privileges (lu_context_t *context); | | gboolean lu_uses_elevated_privileges (struct lu_context *context); | |
| | | | |
|
| gboolean lu_user_default(lu_context_t *ctx, const char *name, | | gboolean lu_user_default(struct lu_context *ctx, const char *name, | |
| gboolean system_account, struct lu_ent *ent); | | gboolean system_account, struct lu_ent *ent); | |
|
| gboolean lu_group_default(lu_context_t *ctx, const char *name, | | gboolean lu_group_default(struct lu_context *ctx, const char *name, | |
| gboolean system_account, struct lu_ent *ent); | | gboolean system_account, struct lu_ent *ent); | |
| | | | |
|
| gboolean lu_user_lookup_name(lu_context_t *context, | | gboolean lu_user_lookup_name(struct lu_context *context, | |
| const char *name, struct lu_ent *ent, | | const char *name, struct lu_ent *ent, | |
|
| lu_error_t **error); | | struct lu_error **error); | |
| gboolean lu_group_lookup_name(lu_context_t *context, | | gboolean lu_group_lookup_name(struct lu_context *context, | |
| const char *name, struct lu_ent *ent, | | const char *name, struct lu_ent *ent, | |
|
| lu_error_t **error); | | struct lu_error **error); | |
| gboolean lu_user_lookup_id(lu_context_t *context, uid_t uid, | | gboolean lu_user_lookup_id(struct lu_context *context, uid_t uid, | |
| struct lu_ent *ent, lu_error_t **error); | | struct lu_ent *ent, struct lu_error **error); | |
| gboolean lu_group_lookup_id(lu_context_t *context, gid_t gid, | | gboolean lu_group_lookup_id(struct lu_context *context, gid_t gid, | |
| struct lu_ent *ent, lu_error_t **error); | | struct lu_ent *ent, struct lu_error **error); | |
| gboolean lu_user_add(lu_context_t *context, | | gboolean lu_user_add(struct lu_context *context, | |
| struct lu_ent *ent, lu_error_t **error); | | struct lu_ent *ent, struct lu_error **error); | |
| gboolean lu_group_add(lu_context_t *context, | | gboolean lu_group_add(struct lu_context *context, | |
| struct lu_ent *ent, lu_error_t **error); | | struct lu_ent *ent, struct lu_error **error); | |
| gboolean lu_user_modify(lu_context_t *context, | | gboolean lu_user_modify(struct lu_context *context, | |
| struct lu_ent *ent, lu_error_t **error); | | struct lu_ent *ent, struct lu_error **error); | |
| gboolean lu_group_modify(lu_context_t *context, | | gboolean lu_group_modify(struct lu_context *context, | |
| struct lu_ent *ent, lu_error_t **error); | | struct lu_ent *ent, struct lu_error **error); | |
| gboolean lu_user_delete(lu_context_t *context, | | gboolean lu_user_delete(struct lu_context *context, | |
| struct lu_ent *ent, lu_error_t **error); | | struct lu_ent *ent, struct lu_error **error); | |
| gboolean lu_group_delete(lu_context_t *context, | | gboolean lu_group_delete(struct lu_context *context, | |
| struct lu_ent *ent, lu_error_t **error); | | struct lu_ent *ent, struct lu_error **error); | |
| | | | |
|
| gboolean lu_user_lock(lu_context_t *context, | | gboolean lu_user_lock(struct lu_context *context, | |
| struct lu_ent *ent, lu_error_t **error); | | struct lu_ent *ent, struct lu_error **error); | |
| gboolean lu_group_lock(lu_context_t *context, | | gboolean lu_group_lock(struct lu_context *context, | |
| struct lu_ent *ent, lu_error_t **error); | | struct lu_ent *ent, struct lu_error **error); | |
| gboolean lu_user_unlock(lu_context_t *context, | | gboolean lu_user_unlock(struct lu_context *context, | |
| struct lu_ent *ent, lu_error_t **error); | | struct lu_ent *ent, struct lu_error **error); | |
| gboolean lu_group_unlock(lu_context_t *context, | | gboolean lu_group_unlock(struct lu_context *context, | |
| struct lu_ent *ent, lu_error_t **error); | | struct lu_ent *ent, struct lu_error **error); | |
| gboolean lu_user_unlock_nonempty(lu_context_t *context, struct lu_ent *ent, | | gboolean lu_user_unlock_nonempty(struct lu_context *context, struct lu_ent | |
| lu_error_t **error); | | *ent, | |
| gboolean lu_group_unlock_nonempty(lu_context_t *context, struct lu_ent *ent | | struct lu_error **error); | |
| , | | gboolean lu_group_unlock_nonempty(struct lu_context *context, | |
| lu_error_t **error); | | struct lu_ent *ent, struct lu_error **erro | |
| | | r); | |
| | | | |
|
| gboolean lu_user_islocked(lu_context_t *context, | | gboolean lu_user_islocked(struct lu_context *context, | |
| struct lu_ent *ent, lu_error_t **error); | | struct lu_ent *ent, struct lu_error **error); | |
| gboolean lu_group_islocked(lu_context_t *context, | | gboolean lu_group_islocked(struct lu_context *context, | |
| struct lu_ent *ent, lu_error_t **error); | | struct lu_ent *ent, struct lu_error **error); | |
| | | | |
|
| gboolean lu_user_setpass(lu_context_t *context, | | gboolean lu_user_setpass(struct lu_context *context, | |
| struct lu_ent *ent, const char *newpass, | | struct lu_ent *ent, const char *newpass, | |
| gboolean crypted, | | gboolean crypted, | |
|
| lu_error_t **error); | | struct lu_error **error); | |
| gboolean lu_group_setpass(lu_context_t *context, | | gboolean lu_group_setpass(struct lu_context *context, | |
| struct lu_ent *ent, const char *newpass, | | struct lu_ent *ent, const char *newpass, | |
| gboolean crypted, | | gboolean crypted, | |
|
| lu_error_t **error); | | struct lu_error **error); | |
| gboolean lu_user_removepass(lu_context_t *context, | | gboolean lu_user_removepass(struct lu_context *context, | |
| struct lu_ent *ent, | | struct lu_ent *ent, | |
|
| lu_error_t **error); | | struct lu_error **error); | |
| gboolean lu_group_removepass(lu_context_t *context, | | gboolean lu_group_removepass(struct lu_context *context, | |
| struct lu_ent *ent, | | struct lu_ent *ent, | |
|
| lu_error_t **error); | | struct lu_error **error); | |
| | | | |
|
| GValueArray *lu_users_enumerate(lu_context_t *context, | | GValueArray *lu_users_enumerate(struct lu_context *context, | |
| const char *pattern, | | const char *pattern, | |
|
| lu_error_t **error); | | struct lu_error **error); | |
| GValueArray *lu_groups_enumerate(lu_context_t *context, | | GValueArray *lu_groups_enumerate(struct lu_context *context, | |
| const char *pattern, | | const char *pattern, | |
|
| lu_error_t **error); | | struct lu_error **error); | |
| GValueArray *lu_users_enumerate_by_group(lu_context_t *context, | | GValueArray *lu_users_enumerate_by_group(struct lu_context *context, | |
| const char *group, | | const char *group, | |
|
| lu_error_t **error); | | struct lu_error **error); | |
| GValueArray *lu_groups_enumerate_by_user(lu_context_t *context, | | GValueArray *lu_groups_enumerate_by_user(struct lu_context *context, | |
| const char *user, | | const char *user, | |
|
| lu_error_t **error); | | struct lu_error **error); | |
| | | | |
|
| GPtrArray *lu_users_enumerate_full(lu_context_t *context, | | GPtrArray *lu_users_enumerate_full(struct lu_context *context, | |
| const char *pattern, | | const char *pattern, | |
|
| lu_error_t **error); | | struct lu_error **error); | |
| GPtrArray *lu_groups_enumerate_full(lu_context_t *context, | | GPtrArray *lu_groups_enumerate_full(struct lu_context *context, | |
| const char *pattern, | | const char *pattern, | |
|
| lu_error_t **error); | | struct lu_error **error); | |
| | | | |
| G_END_DECLS | | G_END_DECLS | |
| #endif | | #endif | |
| | | | |
End of changes. 29 change blocks. |
| 76 lines changed or deleted | | 104 lines changed or added | |
|