mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-25 16:42:34 +00:00
Unable to use < as part of a password (admin-cli) (#24939)
* escaped angle bracket characters in password Closes #21951 Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
This commit is contained in:
@@ -84,19 +84,14 @@ public class KcAdmMain {
|
||||
StringBuilder b = new StringBuilder();
|
||||
for (String s : args) {
|
||||
// quote if necessary
|
||||
boolean needQuote = false;
|
||||
needQuote = s.indexOf(' ') != -1 || s.indexOf('\"') != -1 || s.indexOf('\'') != -1;
|
||||
b.append(' ');
|
||||
if (needQuote) {
|
||||
b.append('\'');
|
||||
}
|
||||
s = s.replace("'", "\\'");
|
||||
b.append('\'');
|
||||
b.append(s);
|
||||
if (needQuote) {
|
||||
b.append('\'');
|
||||
}
|
||||
b.append('\'');
|
||||
}
|
||||
console.setEcho(false);
|
||||
|
||||
|
||||
console.execute("kcadm" + b.toString());
|
||||
|
||||
console.start();
|
||||
|
||||
Reference in New Issue
Block a user