diff options
author | Günther Deschner <gd@samba.org> | 2007-02-02 13:03:06 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:17:40 -0500 |
commit | 48191ddec6cd720b349de33979811a4d9db28172 (patch) | |
tree | 03f51705d419416e2dd47b7b34ca084cde685f87 | |
parent | fd0f2e20eeb331f977be89056cb9603155b4fecd (diff) | |
download | samba-48191ddec6cd720b349de33979811a4d9db28172.tar.gz samba-48191ddec6cd720b349de33979811a4d9db28172.tar.bz2 samba-48191ddec6cd720b349de33979811a4d9db28172.zip |
r21122: Simplify code in pam_winbind a bit.
Guenther
(This used to be commit 08ca5ea6f1b09506055b2508aa79704f39b3bbd7)
-rw-r--r-- | source3/nsswitch/pam_winbind.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/source3/nsswitch/pam_winbind.c b/source3/nsswitch/pam_winbind.c index e8c0988923..d7fb838d9a 100644 --- a/source3/nsswitch/pam_winbind.c +++ b/source3/nsswitch/pam_winbind.c @@ -1593,20 +1593,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"); @@ -1677,22 +1676,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) { |