Skip to content

Commit

Permalink
[FIXED JENKINS-10086] if we failed to check the account disabled flag…
Browse files Browse the repository at this point in the history
…, assume it's enabled.
  • Loading branch information
kohsuke committed Jun 29, 2011
1 parent bba459e commit b2092a9
Showing 1 changed file with 17 additions and 2 deletions.
Expand Up @@ -103,13 +103,28 @@ protected UserDetails retrieveUser(String username, UsernamePasswordAuthenticati

return new ActiveDirectoryUserDetail(
username, password,
!usr.accountDisabled(),
!isAccountDisabled(usr),
true, true, true,
groups.toArray(new GrantedAuthority[groups.size()])
);
}

protected String getDnOfUserOrGroup(String userOrGroupname) {
private boolean isAccountDisabled(IADsUser usr) {
try {
return usr.accountDisabled();
} catch (ComException e) {
if (e.getHRESULT()==0x8000500D)
/*
See http://support.microsoft.com/kb/243440 and JENKINS-10086
We suspect this to be caused by old directory items that do not have this value,
so assume this account is enabled.
*/
return false;
e.printStackTrace();
}
}

protected String getDnOfUserOrGroup(String userOrGroupname) {
_Command cmd = ClassFactory.createCommand();
cmd.activeConnection(con);

Expand Down

0 comments on commit b2092a9

Please sign in to comment.