Changeset 140 for branches/samba-3.0/source/nsswitch/pam_winbind.c
- Timestamp:
- Jul 11, 2008, 1:13:42 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.0/source/nsswitch/pam_winbind.c
r124 r140 1182 1182 } 1183 1183 1184 if (ctrl & WINBIND_CACHED_LOGIN) { 1185 request.flags |= WBFLAG_PAM_CACHED_LOGIN; 1186 } 1187 1184 1188 ret = pam_winbind_request_log(pamh, ctrl, WINBINDD_PAM_CHAUTHTOK, &request, &response, user); 1185 1189 … … 1908 1912 { 1909 1913 1910 /* Make sure that we only do this if 1914 /* Make sure that we only do this if 1911 1915 * a) the chauthtok got initiated during a logon attempt (authenticate->acct_mgmt->chauthtok) 1912 1916 * 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 1915 1925 char *new_authtok_reqd_during_auth = NULL; 1916 1926 struct passwd *pwd = NULL; 1917 1918 if (!(ctrl & WINBIND_KRB5_AUTH)) {1919 return False;1920 }1921 1927 1922 1928 _pam_get_data(pamh, PAM_WINBIND_NEW_AUTHTOK_REQD_DURING_AUTH, &new_authtok_reqd_during_auth); … … 1947 1953 int ret; 1948 1954 unsigned int ctrl; 1955 bool cached_login = False; 1949 1956 1950 1957 /* <DO NOT free() THESE> */ … … 1970 1977 _PAM_LOG_FUNCTION_ENTER("pam_sm_chauthtok", pamh, ctrl, flags); 1971 1978 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 */ 1973 1982 ctrl &= ~WINBIND_CACHED_LOGIN; 1974 1983 … … 2118 2127 &pwdlastset_update); 2119 2128 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 2120 2138 ret = winbind_chauthtok_request(pamh, ctrl, user, pass_old, pass_new, pwdlastset_update); 2121 2139 if (ret) { … … 2130 2148 const char *member = get_member_from_config(pamh, argc, argv, ctrl, d); 2131 2149 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 * */ 2132 2158 2133 2159 ret = winbind_auth_request(pamh, ctrl, user, pass_new,
Note:
See TracChangeset
for help on using the changeset viewer.