diff options
author | Günther Deschner <gd@samba.org> | 2007-02-02 13:03:06 +0000 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2007-02-02 13:03:06 +0000 |
commit | 20348c24cf708dd4ddced4d3ba4eb18fb94d9cbf (patch) | |
tree | 0312f2a659a7d93c28f7b9f4a901233cd561fd0d /source/nsswitch | |
parent | f471a25b779f013494156468c30d01c6f7c07aad (diff) | |
download | samba-20348c24cf708dd4ddced4d3ba4eb18fb94d9cbf.tar.gz samba-20348c24cf708dd4ddced4d3ba4eb18fb94d9cbf.tar.xz samba-20348c24cf708dd4ddced4d3ba4eb18fb94d9cbf.zip |
r21122: Simplify code in pam_winbind a bit.
Guenther
Diffstat (limited to 'source/nsswitch')
-rw-r--r-- | source/nsswitch/pam_winbind.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/source/nsswitch/pam_winbind.c b/source/nsswitch/pam_winbind.c index d69eb982edf..1f3ef8e4746 100644 --- a/source/nsswitch/pam_winbind.c +++ b/source/nsswitch/pam_winbind.c @@ -1320,20 +1320,19 @@ int pam_sm_close_session(pam_handle_t *pamh, int flags, ZERO_STRUCT(response); retval = pam_get_user(pamh, &user, "Username: "); - if (retval == PAM_SUCCESS) { - if (user == NULL) { - _pam_log(pamh, ctrl, LOG_ERR, "username was NULL!"); - retval = PAM_USER_UNKNOWN; - goto out; - } - if (retval == PAM_SUCCESS) { - _pam_log_debug(pamh, ctrl, LOG_DEBUG, "username [%s] obtained", user); - } - } else { - _pam_log_debug(pamh, ctrl, LOG_DEBUG, "could not identify user"); + if (retval) { + _pam_log(pamh, ctrl, LOG_ERR, "could not identify user"); goto out; } + if (user == NULL) { + _pam_log(pamh, ctrl, LOG_ERR, "username was NULL!"); + retval = PAM_USER_UNKNOWN; + goto out; + } + + _pam_log_debug(pamh, ctrl, LOG_DEBUG, "username [%s] obtained", user); + ccname = pam_getenv(pamh, "KRB5CCNAME"); if (ccname == NULL) { _pam_log_debug(pamh, ctrl, LOG_DEBUG, "user has no KRB5CCNAME environment"); @@ -1401,22 +1400,20 @@ int pam_sm_chauthtok(pam_handle_t * pamh, int flags, * First get the name of a user */ ret = pam_get_user(pamh, &user, "Username: "); - if (ret == PAM_SUCCESS) { - if (user == NULL) { - _pam_log(pamh, ctrl, LOG_ERR, "username was NULL!"); - ret = PAM_USER_UNKNOWN; - goto out; - } - if (ret == PAM_SUCCESS) { - _pam_log_debug(pamh, ctrl, LOG_DEBUG, "username [%s] obtained", - user); - } - } else { - _pam_log_debug(pamh, ctrl, LOG_DEBUG, + if (ret) { + _pam_log(pamh, ctrl, LOG_ERR, "password - could not identify user"); goto out; } + if (user == NULL) { + _pam_log(pamh, ctrl, LOG_ERR, "username was NULL!"); + ret = PAM_USER_UNKNOWN; + goto out; + } + + _pam_log_debug(pamh, ctrl, LOG_DEBUG, "username [%s] obtained", user); + /* check if this is really a user in winbindd, not only in NSS */ ret = valid_user(pamh, ctrl, user); switch (ret) { |