summaryrefslogtreecommitdiffstats
path: root/selftest/checkpassword_arg1.sh
blob: ecaeb2ed374900bca437ba759e3c1ffbe2792781 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/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