This is an automated email from the ASF dual-hosted git repository.
rmaucher pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new e6a6f53728 Minor user database fixes
e6a6f53728 is described below
commit e6a6f537289f036b3d57ccda426b1d8ee9256e71
Author: remm <[email protected]>
AuthorDate: Tue Sep 1 09:46:19 2026 +0200
Minor user database fixes
From code review.
---
java/org/apache/catalina/users/GenericGroup.java | 14 ++++++++++++++
java/org/apache/catalina/users/GenericRole.java | 4 ++--
java/org/apache/catalina/users/MemoryUserDatabase.java | 2 +-
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/java/org/apache/catalina/users/GenericGroup.java
b/java/org/apache/catalina/users/GenericGroup.java
index 2c890b1fe5..c27268425d 100644
--- a/java/org/apache/catalina/users/GenericGroup.java
+++ b/java/org/apache/catalina/users/GenericGroup.java
@@ -79,6 +79,20 @@ public class GenericGroup<UD extends UserDatabase> extends
AbstractGroup {
// ------------------------------------------------------------- Properties
+ @Override
+ public void setGroupname(String groupname) {
+ // Note: changing the groupname (which is the key) in a database will
not work
+ // and the group should be removed and added instead
+ }
+
+
+ @Override
+ public void setDescription(String description) {
+ database.modifiedGroup(this);
+ super.setDescription(description);
+ }
+
+
@Override
public Iterator<Role> getRoles() {
return roles.iterator();
diff --git a/java/org/apache/catalina/users/GenericRole.java
b/java/org/apache/catalina/users/GenericRole.java
index 378e46590c..d7f0b72625 100644
--- a/java/org/apache/catalina/users/GenericRole.java
+++ b/java/org/apache/catalina/users/GenericRole.java
@@ -77,8 +77,8 @@ public class GenericRole<UD extends UserDatabase> extends
AbstractRole {
@Override
public void setRolename(String rolename) {
- database.modifiedRole(this);
- super.setRolename(rolename);
+ // Note: changing the rolename (which is the key) in a database will
not work
+ // and the role should be removed and added instead
}
diff --git a/java/org/apache/catalina/users/MemoryUserDatabase.java
b/java/org/apache/catalina/users/MemoryUserDatabase.java
index 7d2a527d2e..e4e9eb7473 100644
--- a/java/org/apache/catalina/users/MemoryUserDatabase.java
+++ b/java/org/apache/catalina/users/MemoryUserDatabase.java
@@ -559,7 +559,7 @@ public class MemoryUserDatabase implements UserDatabase {
writer.print(" <user username=\"");
writer.print(Escape.xml(user.getUsername()));
writer.print("\" password=\"");
- writer.print(Escape.xml(user.getPassword()));
+ writer.print(Escape.xml("", user.getPassword()));
writer.print("\"");
if (null != user.getFullName()) {
writer.print(" fullName=\"");
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]