0
0
Fork 0
mirror of https://github.com/atmoz/sftp.git synced 2024-11-24 12:59:24 -05:00

Hide password in userdata parser

Replace password in log output with asterisks
Fixes #362

## Results:
Before: `[bash] Parsing user data: "user:abc!123:3000:4000:/user/home"`
After: `[bash] Parsing user data: "user:******:3000:4000:/user/home"`
This commit is contained in:
Kim Oliver Drechsel 2023-03-14 12:34:52 +01:00 committed by GitHub
parent eacf693131
commit a30b27bb40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,7 +29,8 @@ function validateArg() {
fi fi
} }
log "Parsing user data: \"$1\"" # Replace password in log output with asterisks
log "Parsing user data: \"$(echo "$1" | cut -d: -f1,3- | sed -e '1,/:/{s/:/:******:/}')\""
IFS=':' read -ra args <<< "$1" IFS=':' read -ra args <<< "$1"
skipIndex=0 skipIndex=0