1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/selftest/checkpassword_arg1.sh
Andreas Schneider 1399b2430a selftest: Reformat shell scripts
shfmt -f selftest/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-03-03 00:59:34 +00:00

22 lines
314 B
Bash
Executable File

#!/bin/sh
#
set -e
set -u
ACCOUNT_NAME="${SAMBA_CPS_ACCOUNT_NAME}"
INVALIDPW="$1"
NEWPW=$(cat -)
echo -n "${NEWPW}" | grep -q "^${INVALIDPW}\$" && {
echo "Found invalid password" >&1
exit 1
}
echo -n "${NEWPW}" | grep -q "^${ACCOUNT_NAME}\$" && {
echo "Password includes ACCOUNT_NAME" >&1
exit 1
}
exit 0