From 255a3e6dd67d91e74541293bf7d3ea696b01b6c1 Mon Sep 17 00:00:00 2001 From: Michael Clarke Date: Sat, 14 Jan 2012 19:13:56 +0000 Subject: [PATCH] JENKINS-7096 - Stop users being created in memory if registration fails --- changelog.html | 3 +++ .../java/hudson/security/HudsonPrivateSecurityRealm.java | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/changelog.html b/changelog.html index 06219a46ac..e223e346c0 100644 --- a/changelog.html +++ b/changelog.html @@ -63,6 +63,9 @@ Upcoming changes
  • OS X installer can optionally create a new user "jenkins" and use it. This user has a writable home directory, making it possible to set up ssh for Jenkins. +
  • + Stop users being created in memory if they failed to provide all the required registration information correctly. + (issue 7096) diff --git a/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java b/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java index d2553e4e08..294100981f 100644 --- a/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java +++ b/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java @@ -302,9 +302,9 @@ public class HudsonPrivateSecurityRealm extends AbstractPasswordBasedSecurityRea if(si.username==null || si.username.length()==0) si.errorMessage = "User name is required"; else { - User user = User.get(si.username); - if(user.getProperty(Details.class)!=null) - si.errorMessage = "User name is already taken. Did you forget the password?"; + User user = User.get(si.username, false); + if (null != user) + si.errorMessage = "User name is already taken"; } if(si.fullname==null || si.fullname.length()==0)