1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/testprogs/blackbox/test_pdbtest.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

117 lines
3.7 KiB
Bash
Raw Normal View History

#!/bin/sh
# Blackbox tests for pdbtest
# Copyright (C) 2006-2007 Jelmer Vernooij <jelmer@samba.org>
# Copyright (C) 2006-2012 Andrew Bartlett <abartlet@samba.org>
if [ $# -lt 2 ]; then
cat <<EOF
Usage: test_pdbtest.sh SERVER PREFIX USER SMBCLIENT SMB_CONF
EOF
exit 1
fi
SERVER=$1
PREFIX=$2
USER=$3
smbclient=$4
SMB_CONF=$5
shift 5
failed=0
samba4bindir="$BINDIR"
pdbtest="$samba4bindir/pdbtest"
pdbedit="$samba4bindir/pdbedit"
net="$samba4bindir/net"
smbpasswd="$samba4bindir/smbpasswd"
texpect="$samba4bindir/texpect"
unc="//$SERVER/tmp"
. $(dirname $0)/subunit.sh
. $(dirname $0)/common_test_fns.inc
selftest: Woraround uid wrapper issues when using bash shell UID_WRAPPER_ROOT=1 is not working properly when tests run in bash shell instead of dash. After some debugging the reason may be dash spawns a subshell to run commands, but bash calls execve instead. Traces attached as reference: /bin/sh -> dash: [2(2)/2 at 17s, 1 errors] samba.blackbox.pdbtest(nt4_dc)(nt4_dc:local) UWRAP_DEBUG(3145) - uwrap_init: Initialize uid_wrapper UWRAP_DEBUG(3145) - uwrap_init_env: uwrap_init_env UWRAP_DEBUG(3145) - uwrap_init: Enabled uid_wrapper as root (real uid=1000) UWRAP_DEBUG(3145) - uwrap_init: Successfully initialized uid_wrapper UWRAP_DEBUG(3144) - uwrap_init: Initialize uid_wrapper UWRAP_DEBUG(3144) - uwrap_init_env: uwrap_init_env UWRAP_DEBUG(3144) - uwrap_init: Enabled uid_wrapper as root (real uid=1000) UWRAP_DEBUG(3144) - uwrap_init: Successfully initialized uid_wrapper /bin/sh -> bash: [2(2)/2 at 17s, 1 errors] samba.blackbox.pdbtest(nt4_dc)(nt4_dc:local) UWRAP_DEBUG(3352) - uwrap_export_ids: uwrap_export_ids UWRAP_DEBUG(3354) - uwrap_export_ids: uwrap_export_ids UWRAP_DEBUG(3354) - uwrap_init: Initialize uid_wrapper UWRAP_DEBUG(3354) - uwrap_init_env: uwrap_init_env UWRAP_DEBUG(3354) - uwrap_init_env: Initialize ruid with 1000 UWRAP_DEBUG(3354) - uwrap_init_env: Initalize euid with 1000 UWRAP_DEBUG(3354) - uwrap_init_env: Initalize suid with 1000 UWRAP_DEBUG(3354) - uwrap_init_env: Initialize ruid with 1000 UWRAP_DEBUG(3354) - uwrap_init_env: Initalize egid with 1000 UWRAP_DEBUG(3354) - uwrap_init_env: Initalize sgid with 1000 UWRAP_DEBUG(3354) - uwrap_init_env: Initalize groups with 4,24,27,30,46,108,1000 UWRAP_DEBUG(3354) - uwrap_init: Enabled uid_wrapper as user (real uid=1000) UWRAP_DEBUG(3354) - uwrap_init: Successfully initialized uid_wrapper UWRAP_DEBUG(3353) - uwrap_export_ids: uwrap_export_ids UWRAP_DEBUG(3353) - uwrap_init: Initialize uid_wrapper UWRAP_DEBUG(3353) - uwrap_init_env: uwrap_init_env UWRAP_DEBUG(3353) - uwrap_init_env: Initialize ruid with 1000 UWRAP_DEBUG(3353) - uwrap_init_env: Initalize euid with 1000 UWRAP_DEBUG(3353) - uwrap_init_env: Initalize suid with 1000 UWRAP_DEBUG(3353) - uwrap_init_env: Initialize ruid with 1000 UWRAP_DEBUG(3353) - uwrap_init_env: Initalize egid with 1000 UWRAP_DEBUG(3353) - uwrap_init_env: Initalize sgid with 1000 UWRAP_DEBUG(3353) - uwrap_init_env: Initalize groups with 4,24,27,30,46,108,1000 UWRAP_DEBUG(3353) - uwrap_init: Enabled uid_wrapper as user (real uid=1000) UWRAP_DEBUG(3353) - uwrap_init: Successfully initialized uid_wrapper Signed-off-by: Samuel Cabrero <scabrero@suse.de> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2019-03-14 12:20:52 +03:00
test_smbpasswd()
{
user=$1
newpass=$2
echo "set password with smbpasswd"
tmpfile=$PREFIX/smbpasswd_change_password_script
cat >$tmpfile <<EOF
selftest: Woraround uid wrapper issues when using bash shell UID_WRAPPER_ROOT=1 is not working properly when tests run in bash shell instead of dash. After some debugging the reason may be dash spawns a subshell to run commands, but bash calls execve instead. Traces attached as reference: /bin/sh -> dash: [2(2)/2 at 17s, 1 errors] samba.blackbox.pdbtest(nt4_dc)(nt4_dc:local) UWRAP_DEBUG(3145) - uwrap_init: Initialize uid_wrapper UWRAP_DEBUG(3145) - uwrap_init_env: uwrap_init_env UWRAP_DEBUG(3145) - uwrap_init: Enabled uid_wrapper as root (real uid=1000) UWRAP_DEBUG(3145) - uwrap_init: Successfully initialized uid_wrapper UWRAP_DEBUG(3144) - uwrap_init: Initialize uid_wrapper UWRAP_DEBUG(3144) - uwrap_init_env: uwrap_init_env UWRAP_DEBUG(3144) - uwrap_init: Enabled uid_wrapper as root (real uid=1000) UWRAP_DEBUG(3144) - uwrap_init: Successfully initialized uid_wrapper /bin/sh -> bash: [2(2)/2 at 17s, 1 errors] samba.blackbox.pdbtest(nt4_dc)(nt4_dc:local) UWRAP_DEBUG(3352) - uwrap_export_ids: uwrap_export_ids UWRAP_DEBUG(3354) - uwrap_export_ids: uwrap_export_ids UWRAP_DEBUG(3354) - uwrap_init: Initialize uid_wrapper UWRAP_DEBUG(3354) - uwrap_init_env: uwrap_init_env UWRAP_DEBUG(3354) - uwrap_init_env: Initialize ruid with 1000 UWRAP_DEBUG(3354) - uwrap_init_env: Initalize euid with 1000 UWRAP_DEBUG(3354) - uwrap_init_env: Initalize suid with 1000 UWRAP_DEBUG(3354) - uwrap_init_env: Initialize ruid with 1000 UWRAP_DEBUG(3354) - uwrap_init_env: Initalize egid with 1000 UWRAP_DEBUG(3354) - uwrap_init_env: Initalize sgid with 1000 UWRAP_DEBUG(3354) - uwrap_init_env: Initalize groups with 4,24,27,30,46,108,1000 UWRAP_DEBUG(3354) - uwrap_init: Enabled uid_wrapper as user (real uid=1000) UWRAP_DEBUG(3354) - uwrap_init: Successfully initialized uid_wrapper UWRAP_DEBUG(3353) - uwrap_export_ids: uwrap_export_ids UWRAP_DEBUG(3353) - uwrap_init: Initialize uid_wrapper UWRAP_DEBUG(3353) - uwrap_init_env: uwrap_init_env UWRAP_DEBUG(3353) - uwrap_init_env: Initialize ruid with 1000 UWRAP_DEBUG(3353) - uwrap_init_env: Initalize euid with 1000 UWRAP_DEBUG(3353) - uwrap_init_env: Initalize suid with 1000 UWRAP_DEBUG(3353) - uwrap_init_env: Initialize ruid with 1000 UWRAP_DEBUG(3353) - uwrap_init_env: Initalize egid with 1000 UWRAP_DEBUG(3353) - uwrap_init_env: Initalize sgid with 1000 UWRAP_DEBUG(3353) - uwrap_init_env: Initalize groups with 4,24,27,30,46,108,1000 UWRAP_DEBUG(3353) - uwrap_init: Enabled uid_wrapper as user (real uid=1000) UWRAP_DEBUG(3353) - uwrap_init: Successfully initialized uid_wrapper Signed-off-by: Samuel Cabrero <scabrero@suse.de> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2019-03-14 12:20:52 +03:00
expect New SMB password:
send ${newpass}\n
expect Retype new SMB password:
send ${newpass}\n
EOF
cmd='UID_WRAPPER_INITIAL_RUID=0 UID_WRAPPER_INITIAL_EUID=0 $texpect $tmpfile $smbpasswd -L $user -c $SMB_CONF'
eval echo "$cmd"
out=$(eval $cmd)
ret=$?
rm -f $tmpfile
if [ $ret -ne 0 ]; then
echo "Failed to change user password $user"
return 1
fi
}
testprogs: Fix shellchecks errors in test_pdbtest.sh testprogs/blackbox/test_pdbtest.sh:61:53: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:73:157: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:76:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:78:92: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:80:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:90:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:92:75: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:96:73: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:100:99: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:104:89: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:111:125: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:115:70: error: Double quote array expansions to avoid re-splitting elements. [SC2068] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2022-06-13 17:03:39 +03:00
testit "pdbtest" $VALGRIND $BINDIR/pdbtest -u $USER "$@" || failed=$(expr $failed + 1)
NEWUSERPASS=testPaSS@01%
echo "set password with pdbedit"
cat >$PREFIX/tmpsmbpasswdscript <<EOF
expect new password:
send ${NEWUSERPASS}\n
expect retype new password:
send ${NEWUSERPASS}\n
EOF
testprogs: Fix shellchecks errors in test_pdbtest.sh testprogs/blackbox/test_pdbtest.sh:61:53: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:73:157: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:76:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:78:92: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:80:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:90:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:92:75: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:96:73: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:100:99: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:104:89: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:111:125: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:115:70: error: Double quote array expansions to avoid re-splitting elements. [SC2068] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2022-06-13 17:03:39 +03:00
testit "create user with pdbedit" $texpect $PREFIX/tmpsmbpasswdscript $VALGRIND $pdbedit --configfile=$SMB_CONF -a $USER --account-desc="pdbedit-test-user" "$@" || failed=$(expr $failed + 1)
USERPASS=$NEWUSERPASS
testprogs: Fix shellchecks errors in test_pdbtest.sh testprogs/blackbox/test_pdbtest.sh:61:53: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:73:157: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:76:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:78:92: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:80:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:90:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:92:75: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:96:73: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:100:99: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:104:89: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:111:125: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:115:70: error: Double quote array expansions to avoid re-splitting elements. [SC2068] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2022-06-13 17:03:39 +03:00
test_smbclient "Test login with user (ntlm)" 'ls' "$unc" -U$USER%$NEWUSERPASS "$@" || failed=$(expr $failed + 1)
testprogs: Fix shellchecks errors in test_pdbtest.sh testprogs/blackbox/test_pdbtest.sh:61:53: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:73:157: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:76:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:78:92: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:80:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:90:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:92:75: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:96:73: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:100:99: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:104:89: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:111:125: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:115:70: error: Double quote array expansions to avoid re-splitting elements. [SC2068] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2022-06-13 17:03:39 +03:00
testit "modify user" $VALGRIND $pdbedit --configfile=$SMB_CONF --modify $USER --drive="D:" "$@" || failed=$(expr $failed + 1)
testprogs: Fix shellchecks errors in test_pdbtest.sh testprogs/blackbox/test_pdbtest.sh:61:53: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:73:157: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:76:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:78:92: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:80:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:90:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:92:75: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:96:73: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:100:99: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:104:89: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:111:125: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:115:70: error: Double quote array expansions to avoid re-splitting elements. [SC2068] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2022-06-13 17:03:39 +03:00
test_smbclient "Test login with user (ntlm)" 'ls' "$unc" -U$USER%$NEWUSERPASS "$@" || failed=$(expr $failed + 1)
NEWUSERPASS=testPaSS@02%
selftest: Woraround uid wrapper issues when using bash shell UID_WRAPPER_ROOT=1 is not working properly when tests run in bash shell instead of dash. After some debugging the reason may be dash spawns a subshell to run commands, but bash calls execve instead. Traces attached as reference: /bin/sh -> dash: [2(2)/2 at 17s, 1 errors] samba.blackbox.pdbtest(nt4_dc)(nt4_dc:local) UWRAP_DEBUG(3145) - uwrap_init: Initialize uid_wrapper UWRAP_DEBUG(3145) - uwrap_init_env: uwrap_init_env UWRAP_DEBUG(3145) - uwrap_init: Enabled uid_wrapper as root (real uid=1000) UWRAP_DEBUG(3145) - uwrap_init: Successfully initialized uid_wrapper UWRAP_DEBUG(3144) - uwrap_init: Initialize uid_wrapper UWRAP_DEBUG(3144) - uwrap_init_env: uwrap_init_env UWRAP_DEBUG(3144) - uwrap_init: Enabled uid_wrapper as root (real uid=1000) UWRAP_DEBUG(3144) - uwrap_init: Successfully initialized uid_wrapper /bin/sh -> bash: [2(2)/2 at 17s, 1 errors] samba.blackbox.pdbtest(nt4_dc)(nt4_dc:local) UWRAP_DEBUG(3352) - uwrap_export_ids: uwrap_export_ids UWRAP_DEBUG(3354) - uwrap_export_ids: uwrap_export_ids UWRAP_DEBUG(3354) - uwrap_init: Initialize uid_wrapper UWRAP_DEBUG(3354) - uwrap_init_env: uwrap_init_env UWRAP_DEBUG(3354) - uwrap_init_env: Initialize ruid with 1000 UWRAP_DEBUG(3354) - uwrap_init_env: Initalize euid with 1000 UWRAP_DEBUG(3354) - uwrap_init_env: Initalize suid with 1000 UWRAP_DEBUG(3354) - uwrap_init_env: Initialize ruid with 1000 UWRAP_DEBUG(3354) - uwrap_init_env: Initalize egid with 1000 UWRAP_DEBUG(3354) - uwrap_init_env: Initalize sgid with 1000 UWRAP_DEBUG(3354) - uwrap_init_env: Initalize groups with 4,24,27,30,46,108,1000 UWRAP_DEBUG(3354) - uwrap_init: Enabled uid_wrapper as user (real uid=1000) UWRAP_DEBUG(3354) - uwrap_init: Successfully initialized uid_wrapper UWRAP_DEBUG(3353) - uwrap_export_ids: uwrap_export_ids UWRAP_DEBUG(3353) - uwrap_init: Initialize uid_wrapper UWRAP_DEBUG(3353) - uwrap_init_env: uwrap_init_env UWRAP_DEBUG(3353) - uwrap_init_env: Initialize ruid with 1000 UWRAP_DEBUG(3353) - uwrap_init_env: Initalize euid with 1000 UWRAP_DEBUG(3353) - uwrap_init_env: Initalize suid with 1000 UWRAP_DEBUG(3353) - uwrap_init_env: Initialize ruid with 1000 UWRAP_DEBUG(3353) - uwrap_init_env: Initalize egid with 1000 UWRAP_DEBUG(3353) - uwrap_init_env: Initalize sgid with 1000 UWRAP_DEBUG(3353) - uwrap_init_env: Initalize groups with 4,24,27,30,46,108,1000 UWRAP_DEBUG(3353) - uwrap_init: Enabled uid_wrapper as user (real uid=1000) UWRAP_DEBUG(3353) - uwrap_init: Successfully initialized uid_wrapper Signed-off-by: Samuel Cabrero <scabrero@suse.de> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2019-03-14 12:20:52 +03:00
testit "set user password with smbpasswd" \
test_smbpasswd $USER $NEWUSERPASS ||
failed=$(expr $failed + 1)
USERPASS=$NEWUSERPASS
testprogs: Fix shellchecks errors in test_pdbtest.sh testprogs/blackbox/test_pdbtest.sh:61:53: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:73:157: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:76:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:78:92: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:80:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:90:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:92:75: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:96:73: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:100:99: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:104:89: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:111:125: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:115:70: error: Double quote array expansions to avoid re-splitting elements. [SC2068] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2022-06-13 17:03:39 +03:00
test_smbclient "Test login with user (ntlm)" 'ls' "$unc" -U$USER%$NEWUSERPASS "$@" || failed=$(expr $failed + 1)
testprogs: Fix shellchecks errors in test_pdbtest.sh testprogs/blackbox/test_pdbtest.sh:61:53: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:73:157: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:76:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:78:92: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:80:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:90:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:92:75: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:96:73: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:100:99: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:104:89: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:111:125: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:115:70: error: Double quote array expansions to avoid re-splitting elements. [SC2068] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2022-06-13 17:03:39 +03:00
testit "modify user - disabled" $VALGRIND $net sam set disabled $USER yes "$@" || failed=$(expr $failed + 1)
testit_expect_failure "Test login with disabled suer" $VALGRIND $smbclient //$SERVER/tmp -c 'ls' -U$USER@%$USERPASS || failed=$(expr $failed + 1)
testprogs: Fix shellchecks errors in test_pdbtest.sh testprogs/blackbox/test_pdbtest.sh:61:53: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:73:157: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:76:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:78:92: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:80:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:90:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:92:75: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:96:73: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:100:99: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:104:89: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:111:125: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:115:70: error: Double quote array expansions to avoid re-splitting elements. [SC2068] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2022-06-13 17:03:39 +03:00
testit "modify user - enabled" $VALGRIND $net sam set disabled $USER no "$@" || failed=$(expr $failed + 1)
test_smbclient "Test login with re-enabled user (ntlm)" 'ls' "$unc" -U$USER%$NEWUSERPASS || failed=$(expr $failed + 1)
testprogs: Fix shellchecks errors in test_pdbtest.sh testprogs/blackbox/test_pdbtest.sh:61:53: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:73:157: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:76:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:78:92: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:80:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:90:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:92:75: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:96:73: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:100:99: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:104:89: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:111:125: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:115:70: error: Double quote array expansions to avoid re-splitting elements. [SC2068] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2022-06-13 17:03:39 +03:00
testit "modify user - must change password now" $VALGRIND $net sam set pwdmustchangenow $USER yes "$@" || failed=$(expr $failed + 1)
testit_expect_failure "Test login with expired password" $VALGRIND $smbclient //$SERVER/tmp -c 'ls' -U$USER@%$USERPASS || failed=$(expr $failed + 1)
testprogs: Fix shellchecks errors in test_pdbtest.sh testprogs/blackbox/test_pdbtest.sh:61:53: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:73:157: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:76:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:78:92: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:80:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:90:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:92:75: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:96:73: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:100:99: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:104:89: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:111:125: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:115:70: error: Double quote array expansions to avoid re-splitting elements. [SC2068] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2022-06-13 17:03:39 +03:00
testit "modify user - disable password expiry" $VALGRIND $net sam set pwnoexp $USER yes "$@" || failed=$(expr $failed + 1)
test_smbclient "Test login with no expiry (ntlm)" 'ls' "$unc" -U$USER%$NEWUSERPASS || failed=$(expr $failed + 1)
NEWUSERPASS=testPaSS@03%
NEWUSERHASH=062519096c45739c1938800f80906731
testprogs: Fix shellchecks errors in test_pdbtest.sh testprogs/blackbox/test_pdbtest.sh:61:53: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:73:157: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:76:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:78:92: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:80:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:90:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:92:75: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:96:73: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:100:99: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:104:89: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:111:125: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:115:70: error: Double quote array expansions to avoid re-splitting elements. [SC2068] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2022-06-13 17:03:39 +03:00
testit "Set user password with password hash" $VALGRIND $pdbedit --configfile=$SMB_CONF -u $USER --set-nt-hash $NEWUSERHASH "$@" || failed=$(expr $failed + 1)
test_smbclient "Test login with new password (from hash)" 'ls' "$unc" -U$USER%$NEWUSERPASS || failed=$(expr $failed + 1)
testprogs: Fix shellchecks errors in test_pdbtest.sh testprogs/blackbox/test_pdbtest.sh:61:53: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:73:157: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:76:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:78:92: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:80:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:90:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:92:75: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:96:73: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:100:99: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:104:89: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:111:125: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:115:70: error: Double quote array expansions to avoid re-splitting elements. [SC2068] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2022-06-13 17:03:39 +03:00
testit "del user" $VALGRIND $pdbedit --configfile=$SMB_CONF -x $USER "$@" || failed=$(expr $failed + 1)
rm $PREFIX/tmpsmbpasswdscript
exit $failed