optimize logging
This commit is contained in:
parent
5591323259
commit
02e4e1adbc
@ -27,8 +27,11 @@ public class CommandShell {
|
|||||||
if (stdInput != null && !"newusers".equals(logCommand)) {
|
if (stdInput != null && !"newusers".equals(logCommand)) {
|
||||||
if (logCommand != null && (logCommand.startsWith("newusers") || logCommand.startsWith("chpasswd"))) {
|
if (logCommand != null && (logCommand.startsWith("newusers") || logCommand.startsWith("chpasswd"))) {
|
||||||
// escape new password !
|
// escape new password !
|
||||||
final String[] strings = stdInput.split(":", 3);
|
final String[] strings = stdInput.split("\\:", 3);
|
||||||
logCommand += "<<EOF\n" + strings[0] + ":***:" + strings[2] + "EOF";
|
logCommand += "<<EOF\n" + strings[0] + ":***:";
|
||||||
|
if (strings.length > 2) {
|
||||||
|
logCommand += strings[2] + "EOF";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
logCommand += "<<EOF\n" + stdInput + "EOF";
|
logCommand += "<<EOF\n" + stdInput + "EOF";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user