diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2007-04-27 12:48:51 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2007-04-27 12:48:51 +0000 |
| commit | 3fb59b5bfef97f2a46b5a47e5beaed547e1fc14c (patch) | |
| tree | 4c3295700f2b9cd4a597f910b1cd05c75bd6f8c8 /qpid/java/broker/src/main | |
| parent | c266140028a3a4aa61b7ee1a557b768c9e0f21d8 (diff) | |
| download | qpid-python-3fb59b5bfef97f2a46b5a47e5beaed547e1fc14c.tar.gz | |
Merged revisions 533075-533079 via svnmerge from
https://svn.apache.org/repos/asf/incubator/qpid/branches/M2
........
r533075 | ritchiem | 2007-04-27 13:27:19 +0100 (Fri, 27 Apr 2007) | 2 lines
QPID-473 Base64MD5PrincipalDatabase doesn't check password changes were applied to disk before storing in memory
Reversed the effects of the requested change if the changes cannot be persisted to disk
........
r533077 | ritchiem | 2007-04-27 13:29:52 +0100 (Fri, 27 Apr 2007) | 3 lines
Bin Updates: Qpid-Run removed new bash 3.x feature += replaced with option="${value1} ${value2}" constructs to support older bash 2.x
renamed passwd qpid-passwd and fixed classpath loading errors.
Moved bdbbackup script to live with the bdb module.
........
r533078 | ritchiem | 2007-04-27 13:30:07 +0100 (Fri, 27 Apr 2007) | 1 line
Updated PrincipalDatabase implementations to return empty strings rather than null. As this causes NPE on MC.
........
r533079 | ritchiem | 2007-04-27 13:31:03 +0100 (Fri, 27 Apr 2007) | 1 line
Updated MLT to have variables that define the BROKER and VHOST used and White space
........
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@533083 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker/src/main')
3 files changed, 9 insertions, 19 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java index 8ade3cdd98..10adfdd9fc 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java @@ -182,6 +182,7 @@ public class Base64MD5PasswordFilePrincipalDatabase implements PrincipalDatabase try { _userUpdate.lock(); + char[] orig = user.getPassword(); user.setPassword(password); try @@ -192,6 +193,8 @@ public class Base64MD5PasswordFilePrincipalDatabase implements PrincipalDatabase { _logger.error("Unable to save password file, password change for user'" + principal + "' will revert at restart"); + //revert the password change + user.setPassword(orig); return false; } return true; @@ -210,22 +213,6 @@ public class Base64MD5PasswordFilePrincipalDatabase implements PrincipalDatabase } } - private char[] convertPassword(String password) throws UnsupportedEncodingException - { - byte[] passwdBytes = password.getBytes(DEFAULT_ENCODING); - - char[] passwd = new char[passwdBytes.length]; - - int index = 0; - - for (byte b : passwdBytes) - { - passwd[index++] = (char) b; - } - - return passwd; - } - public boolean createPrincipal(Principal principal, char[] password) { if (_users.get(principal.getName()) != null) @@ -247,9 +234,10 @@ public class Base64MD5PasswordFilePrincipalDatabase implements PrincipalDatabase } catch (IOException e) { + //remove the use on failure. + _users.remove(user.getName()); return false; } - } finally { diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java index 5170f6216c..c49f4e2a33 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java @@ -39,6 +39,7 @@ import java.util.regex.Pattern; import java.util.Map; import java.util.HashMap; import java.util.List; +import java.util.LinkedList; import java.security.Principal; /** @@ -157,7 +158,7 @@ public class PlainPasswordFilePrincipalDatabase implements PrincipalDatabase public List<Principal> getUsers() { - return null; //todo + return new LinkedList<Principal>(); //todo } public Principal getUser(String username) diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabase.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabase.java index 49cd71e978..73d58ca489 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabase.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabase.java @@ -31,6 +31,7 @@ import java.util.Properties; import java.util.Map; import java.util.HashMap; import java.util.List; +import java.util.LinkedList; import java.security.Principal; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -142,7 +143,7 @@ public class PropertiesPrincipalDatabase implements PrincipalDatabase public List<Principal> getUsers() { - return null; //todo + return new LinkedList<Principal>(); //todo } public Principal getUser(String username) |
