diff --git a/ReleaseNotes/ReleaseNotes-2.1.2.4.txt b/ReleaseNotes/ReleaseNotes-2.1.2.4.txt index f511c2719a..c651b69fd4 100644 --- a/ReleaseNotes/ReleaseNotes-2.1.2.4.txt +++ b/ReleaseNotes/ReleaseNotes-2.1.2.4.txt @@ -32,6 +32,13 @@ technically a bug to produce a repository like this) wouldn't clone properly from the embedded Gerrit SSH or HTTP daemon. Fixed upstream in JGit 0.7.0, but we never picked up the bug fix release. +* Allow LDAP to unset the user name ++ +If the user name is configured to be set only by the LDAP directory, +and an account has a user name, but the name is no longer present +in the directory, Gerrit crashed during sign-in while trying to +clear out the user name. Fixed. + Documentation Corrections ~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/account/ChangeUserName.java b/gerrit-server/src/main/java/com/google/gerrit/server/account/ChangeUserName.java index d8951bf1e2..1509299447 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/account/ChangeUserName.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/account/ChangeUserName.java @@ -36,6 +36,8 @@ import java.util.Collections; import java.util.concurrent.Callable; import java.util.regex.Pattern; +import javax.annotation.Nullable; + /** Operation to change the username of an account. */ public class ChangeUserName implements Callable { private static final Pattern USER_NAME_PATTERN = @@ -77,7 +79,7 @@ public class ChangeUserName implements Callable { final SshKeyCache sshKeyCache, @Assisted final ReviewDb db, @Assisted final IdentifiedUser user, - @Assisted final String newUsername) { + @Nullable @Assisted final String newUsername) { this.accountCache = accountCache; this.sshKeyCache = sshKeyCache;