diff options
author | Sumit Bose <sbose@redhat.com> | 2013-08-01 12:40:24 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-08-26 11:44:42 +0200 |
commit | 1e9930690691360d8963eecea4918b36b6d51013 (patch) | |
tree | 8a36695aca78ac55d8c587fb6c7ef57e3be6e7ab /src/responder/pac/pacsrv_utils.c | |
parent | f88f09876e2018bd08e19d84ad1ab66f72cac8fd (diff) | |
download | sssd-1e9930690691360d8963eecea4918b36b6d51013.tar.gz sssd-1e9930690691360d8963eecea4918b36b6d51013.tar.xz sssd-1e9930690691360d8963eecea4918b36b6d51013.zip |
PAC: if user entry already exists keep it
Currently the PAC responder deletes a user entry and recreates it if
some attributes seems to be different.
Two of the attributes where the home directory and the shell of the
user. Those two attributes are not available from the PAC but where
generates by the PAC responder. The corresponding ID provider might have
better means to determine those attributes, e.g. read them from LDAP, so
we shouldn't change them here.
The third attribute is the user name. Since the PAC responder does
lookups only based on the UID we can wait until the ID provider updates
the entry.
Fixes https://fedorahosted.org/sssd/ticket/1996
Diffstat (limited to 'src/responder/pac/pacsrv_utils.c')
-rw-r--r-- | src/responder/pac/pacsrv_utils.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/responder/pac/pacsrv_utils.c b/src/responder/pac/pacsrv_utils.c index f70438b66..a52282c79 100644 --- a/src/responder/pac/pacsrv_utils.c +++ b/src/responder/pac/pacsrv_utils.c @@ -506,42 +506,3 @@ done: return ret; } - -static bool compare_string_with_attr(const char *val, struct ldb_message *msg, - const char *attr) -{ - const char *str; - - str = ldb_msg_find_attr_as_string(msg, attr, NULL); - if ((str == NULL && val == NULL) || - (str != NULL && val != NULL && strcmp(str, val) == 0)) { - return true; - } - - return false; -} - -bool new_and_cached_user_differs(struct passwd *pwd, struct ldb_message *msg) -{ - if (pwd == NULL || msg == NULL) { - return true; - } - - if (!compare_string_with_attr(pwd->pw_name, msg, SYSDB_NAME) && - !compare_string_with_attr(pwd->pw_name, msg, SYSDB_NAME_ALIAS)) { - DEBUG(SSSDBG_TRACE_FUNC, ("Names differ.")); - return true; - } - - if (!compare_string_with_attr(pwd->pw_dir, msg, SYSDB_HOMEDIR)) { - DEBUG(SSSDBG_TRACE_FUNC, ("Home directories differ.")); - return true; - } - - if (!compare_string_with_attr(pwd->pw_shell, msg, SYSDB_SHELL)) { - DEBUG(SSSDBG_TRACE_FUNC, ("Shells differ.")); - return true; - } - - return false; -} |