diff options
author | Simo Sorce <ssorce@redhat.com> | 2009-03-08 20:19:48 -0400 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2009-03-09 15:29:37 -0400 |
commit | 5ea221d5325a2b60ec872a3864953178c8b593a0 (patch) | |
tree | 5a67d8702ec6921b8a390c69e3235a949ec6900a | |
parent | 10038e62d8ea6ee570346f98819e1994e70d47a5 (diff) | |
download | sssd-5ea221d5325a2b60ec872a3864953178c8b593a0.tar.gz sssd-5ea221d5325a2b60ec872a3864953178c8b593a0.tar.bz2 sssd-5ea221d5325a2b60ec872a3864953178c8b593a0.zip |
Do not duplicate attribute names macros.
Also shorten names oh other user attributes.
-rw-r--r-- | server/db/sysdb.h | 39 | ||||
-rw-r--r-- | server/infopipe/infopipe_users.c | 20 | ||||
-rw-r--r-- | server/responder/pam/pam_LOCAL_domain.c | 4 | ||||
-rw-r--r-- | server/tests/infopipe-tests.c | 2 |
4 files changed, 31 insertions, 34 deletions
diff --git a/server/db/sysdb.h b/server/db/sysdb.h index e323ad0d..c278e64c 100644 --- a/server/db/sysdb.h +++ b/server/db/sysdb.h @@ -53,16 +53,13 @@ #define SYSDB_MEMBER "member" #define SYSDB_LEGACY_MEMBER "memberUid" -#define SYSDB_USER_ATTR_DEFAULTGROUP "defaultGroup" -#define SYSDB_USER_ATTR_GECOS "gecos" -#define SYSDB_USER_ATTR_HOMEDIR "homeDirectory" -#define SYSDB_USER_ATTR_SHELL "shell" -#define SYSDB_USER_ATTR_FULLNAME "fullName" -#define SYSDB_USER_ATTR_LOCALE "locale" -#define SYSDB_USER_ATTR_KEYBOARD "keyboard" -#define SYSDB_USER_ATTR_SESSION "session" -#define SYSDB_USER_ATTR_LAST_LOGIN "lastLogin" -#define SYSDB_USER_ATTR_USERPIC "userPicture" +#define SYSDB_DEFAULTGROUP "defaultGroup" +#define SYSDB_GECOS "gecos" +#define SYSDB_LOCALE "locale" +#define SYSDB_KEYBOARD "keyboard" +#define SYSDB_SESSION "session" +#define SYSDB_LAST_LOGIN "lastLogin" +#define SYSDB_USERPIC "userPicture" #define SYSDB_LAST_UPDATE "lastUpdate" @@ -81,7 +78,7 @@ #define SYSDB_INITGR_LEGACY_FILTER "(&(objectclass="SYSDB_GROUP_CLASS")("SYSDB_LEGACY_MEMBER"=%s))" -#define SYSDB_GETCACHED_FILTER "(&(objectclass="SYSDB_USER_CLASS")("SYSDB_USER_ATTR_LAST_LOGIN">=%lu))" +#define SYSDB_GETCACHED_FILTER "(&(objectclass="SYSDB_USER_CLASS")("SYSDB_LAST_LOGIN">=%lu))" #define SYSDB_PW_ATTRS {SYSDB_NAME, SYSDB_UIDNUM, \ SYSDB_GIDNUM, SYSDB_FULLNAME, \ @@ -89,16 +86,16 @@ SYSDB_LAST_UPDATE, \ "objectClass", \ NULL} -#define SYSDB_USER_ATTRS {SYSDB_USER_ATTR_DEFAULTGROUP, \ - SYSDB_USER_ATTR_GECOS, \ - SYSDB_USER_ATTR_HOMEDIR, \ - SYSDB_USER_ATTR_SHELL, \ - SYSDB_USER_ATTR_FULLNAME, \ - SYSDB_USER_ATTR_LOCALE, \ - SYSDB_USER_ATTR_KEYBOARD, \ - SYSDB_USER_ATTR_SESSION, \ - SYSDB_USER_ATTR_LAST_LOGIN, \ - SYSDB_USER_ATTR_USERPIC, \ +#define SYSDB_USER_ATTRS {SYSDB_DEFAULTGROUP, \ + SYSDB_GECOS, \ + SYSDB_HOMEDIR, \ + SYSDB_SHELL, \ + SYSDB_FULLNAME, \ + SYSDB_LOCALE, \ + SYSDB_KEYBOARD, \ + SYSDB_SESSION, \ + SYSDB_LAST_LOGIN, \ + SYSDB_USERPIC, \ SYSDB_LAST_UPDATE, \ NULL} #define SYSDB_GRNAM_ATTRS {SYSDB_NAME, SYSDB_GIDNUM, \ diff --git a/server/infopipe/infopipe_users.c b/server/infopipe/infopipe_users.c index 19608090..29e87a9e 100644 --- a/server/infopipe/infopipe_users.c +++ b/server/infopipe/infopipe_users.c @@ -1118,16 +1118,16 @@ static const char **infp_get_all_attributes(TALLOC_CTX *mem_ctx, return NULL; } - attributes[offset++] = SYSDB_USER_ATTR_DEFAULTGROUP; - attributes[offset++] = SYSDB_USER_ATTR_GECOS; - attributes[offset++] = SYSDB_USER_ATTR_HOMEDIR; - attributes[offset++] = SYSDB_USER_ATTR_SHELL; - attributes[offset++] = SYSDB_USER_ATTR_FULLNAME; - attributes[offset++] = SYSDB_USER_ATTR_LOCALE; - attributes[offset++] = SYSDB_USER_ATTR_KEYBOARD; - attributes[offset++] = SYSDB_USER_ATTR_SESSION; - attributes[offset++] = SYSDB_USER_ATTR_LAST_LOGIN; - attributes[offset++] = SYSDB_USER_ATTR_USERPIC; + attributes[offset++] = SYSDB_DEFAULTGROUP; + attributes[offset++] = SYSDB_GECOS; + attributes[offset++] = SYSDB_HOMEDIR; + attributes[offset++] = SYSDB_SHELL; + attributes[offset++] = SYSDB_FULLNAME; + attributes[offset++] = SYSDB_LOCALE; + attributes[offset++] = SYSDB_KEYBOARD; + attributes[offset++] = SYSDB_SESSION; + attributes[offset++] = SYSDB_LAST_LOGIN; + attributes[offset++] = SYSDB_USERPIC; return attributes; } diff --git a/server/responder/pam/pam_LOCAL_domain.c b/server/responder/pam/pam_LOCAL_domain.c index b1a459b9..90abf63e 100644 --- a/server/responder/pam/pam_LOCAL_domain.c +++ b/server/responder/pam/pam_LOCAL_domain.c @@ -150,7 +150,7 @@ static void do_successful_login(struct LOCAL_request *lreq) lreq->error, ENOMEM, done); ret = sysdb_attrs_add_long(lreq->mod_attrs, - SYSDB_USER_ATTR_LAST_LOGIN, (long)time(NULL)); + SYSDB_LAST_LOGIN, (long)time(NULL)); NEQ_CHECK_OR_JUMP(ret, EOK, ("sysdb_attrs_add_long failed.\n"), lreq->error, ret, done); @@ -388,7 +388,7 @@ int LOCAL_pam_handler(struct cli_ctx *cctx, pam_dp_callback_t callback, static const char *attrs[] = {SYSDB_NAME, SYSDB_PWD, SYSDB_DISABLED, - SYSDB_USER_ATTR_LAST_LOGIN, + SYSDB_LAST_LOGIN, "lastPasswordChange", "accountExpires", "failedLoginAttempts", diff --git a/server/tests/infopipe-tests.c b/server/tests/infopipe-tests.c index 8bc0f054..cc75215a 100644 --- a/server/tests/infopipe-tests.c +++ b/server/tests/infopipe-tests.c @@ -280,7 +280,7 @@ START_TEST(test_infp_set_user_attrs) DBusMessage *setattr_req; const char *username = "testuser1"; const char *domain = "LOCAL"; - const char *shell_attr = SYSDB_USER_ATTR_SHELL; + const char *shell_attr = SYSDB_SHELL; const char *shell_value = "/usr/bin/testshell"; DBusMessageIter iter, array_iter, dict_array_iter, dict_iter, variant_iter; DBusError error; |