Skip to content

Commit

Permalink
Hide password in userdata parser
Browse files Browse the repository at this point in the history
Replace password in log output with asterisks
Fixes atmoz#362

## Results:
Before: `[bash] Parsing user data: "user:abc!123:3000:4000:/user/home"`
After: `[bash] Parsing user data: "user:******:3000:4000:/user/home"`
  • Loading branch information
kimdre authored Mar 14, 2023
1 parent eacf693 commit a30b27b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion files/create-sftp-user
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ function validateArg() {
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"

skipIndex=0
Expand Down

0 comments on commit a30b27b

Please sign in to comment.