Ignore:
Timestamp:
Jul 11, 2008, 1:13:42 AM (17 years ago)
Author:
Paul Smedley
Message:

Update branch to 3.0.31 release

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/nsswitch/pam_winbind.c

    r124 r140  
    11821182        }
    11831183
     1184        if (ctrl & WINBIND_CACHED_LOGIN) {
     1185                request.flags |= WBFLAG_PAM_CACHED_LOGIN;
     1186        }
     1187
    11841188        ret = pam_winbind_request_log(pamh, ctrl, WINBINDD_PAM_CHAUTHTOK, &request, &response, user);
    11851189
     
    19081912{
    19091913
    1910         /* Make sure that we only do this if 
     1914        /* Make sure that we only do this if
    19111915         * a) the chauthtok got initiated during a logon attempt (authenticate->acct_mgmt->chauthtok)
    19121916         * b) any later password change via the "passwd" command if done by the user itself
    1913          */
    1914                
     1917         *
     1918         * NB. If we login from gdm or xdm and the password expires,
     1919         * we change the password, but there is no memory cache.
     1920         * Thus, even for passthrough login, we should do the
     1921         * authentication again to update memory cache.
     1922         * --- BoYang
     1923         * */
     1924
    19151925        char *new_authtok_reqd_during_auth = NULL;
    19161926        struct passwd *pwd = NULL;
    1917 
    1918         if (!(ctrl & WINBIND_KRB5_AUTH)) {
    1919                 return False;
    1920         }
    19211927
    19221928        _pam_get_data(pamh, PAM_WINBIND_NEW_AUTHTOK_REQD_DURING_AUTH, &new_authtok_reqd_during_auth);
     
    19471953        int ret;
    19481954        unsigned int ctrl;
     1955        bool cached_login = False;
    19491956
    19501957        /* <DO NOT free() THESE> */
     
    19701977        _PAM_LOG_FUNCTION_ENTER("pam_sm_chauthtok", pamh, ctrl, flags);
    19711978
    1972         /* clearing offline bit for the auth in the password change */
     1979        cached_login = (ctrl & WINBIND_CACHED_LOGIN);
     1980
     1981        /* clearing offline bit for auth */
    19731982        ctrl &= ~WINBIND_CACHED_LOGIN;
    19741983
     
    21182127                               &pwdlastset_update);
    21192128
     2129                /*
     2130                 * if cached creds were enabled, make sure to set the
     2131                 * WINBIND_CACHED_LOGIN bit here in order to have winbindd
     2132                 * update the cached creds storage - gd
     2133                 */
     2134                if (cached_login) {
     2135                        ctrl |= WINBIND_CACHED_LOGIN;
     2136                }
     2137
    21202138                ret = winbind_chauthtok_request(pamh, ctrl, user, pass_old, pass_new, pwdlastset_update);
    21212139                if (ret) {
     
    21302148                        const char *member = get_member_from_config(pamh, argc, argv, ctrl, d);
    21312149                        const char *cctype = get_krb5_cc_type_from_config(pamh, argc, argv, ctrl, d);
     2150
     2151                        /* Keep the WINBIND_CACHED_LOGIN bit for
     2152                         * authentication after changing the password.
     2153                         * This will update the cached credentials in case
     2154                         * that winbindd_dual_pam_chauthtok() fails
     2155                         * to update them.
     2156                         * --- BoYang
     2157                         * */
    21322158
    21332159                        ret = winbind_auth_request(pamh, ctrl, user, pass_new,
Note: See TracChangeset for help on using the changeset viewer.