[SCM] Samba Shared Repository - branch master updated
Andreas Schneider
asn at samba.org
Thu May 7 10:39:03 UTC 2020
The branch, master has been updated
via c83ce5f4f99 lib:util: Fix smbclient -l basename dir
via 2a7fc40fb3f Add a test for smbclient -l basename
from 3d2dd6296d5 lib util asn1: modernize debug calls
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit c83ce5f4f99aef94530411ec82cc03e9935b352d
Author: Amit Kumar <amitkuma at redhat.com>
Date: Wed Apr 22 06:53:42 2020 -0500
lib:util: Fix smbclient -l basename dir
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14345
Pair-Programmed-With: Andreas Schneider <asn at samba.org>
Signed-off-by: Andreas Schneider <asn at samba.org>
Signed-off-by: Amit Kumar <amitkuma at redhat.com>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Thu May 7 10:38:29 UTC 2020 on sn-devel-184
commit 2a7fc40fb3f3ca994cecad3e2957433d7a411208
Author: Amit Kumar <amitkuma at redhat.com>
Date: Wed Apr 22 06:53:33 2020 -0500
Add a test for smbclient -l basename
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14345
Signed-off-by: Amit Kumar <amitkuma at redhat.com>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Alexander Bokovoy <ab at samba.org>
-----------------------------------------------------------------------
Summary of changes:
lib/util/debug.c | 8 ++++-
.../script/tests/test_smbclient_log_basename.sh | 36 ++++++++++++++++++++++
source3/selftest/tests.py | 3 ++
3 files changed, 46 insertions(+), 1 deletion(-)
create mode 100755 source3/script/tests/test_smbclient_log_basename.sh
Changeset truncated at 500 lines:
diff --git a/lib/util/debug.c b/lib/util/debug.c
index 0b203cd45a3..4b9a79e0b6f 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -1140,9 +1140,15 @@ bool reopen_logs_internal(void)
dbgc_config[DBGC_ALL].fd = 2;
return true;
- case DEBUG_FILE:
+ case DEBUG_FILE: {
+ struct debug_backend *b = debug_find_backend("file");
+
+ if (b != NULL) {
+ b->log_level = dbgc_config[DBGC_ALL].loglevel;
+ }
break;
}
+ }
oldumask = umask( 022 );
diff --git a/source3/script/tests/test_smbclient_log_basename.sh b/source3/script/tests/test_smbclient_log_basename.sh
new file mode 100755
index 00000000000..c721b3f5ca1
--- /dev/null
+++ b/source3/script/tests/test_smbclient_log_basename.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# this test checks whether smbclient can log into -l log-basename
+
+if [ $# -lt 2 ]; then
+cat <<EOF
+Usage: test_smbclient_log_basename.sh SERVER SMBCLIENT PREFIX <smbclient arguments>
+EOF
+exit 1;
+fi
+
+SERVER="$1"
+SMBCLIENT="$2"
+PREFIX="$3"
+shift 3
+ADDARGS="$*"
+
+incdir=`dirname $0`/../../../testprogs/blackbox
+. $incdir/subunit.sh
+
+failed=0
+
+LOG_DIR=$PREFIX/st_log_basename_dir
+
+test_smbclient_log_basename()
+{
+ rm -rf $LOG_DIR
+ mkdir $LOG_DIR
+ cmd='$VALGRIND $SMBCLIENT -l $LOG_DIR -d3 //$SERVER/IPC\$ $CONFIGURATION -U%badpassword -c quit $ADDARGS'
+ out=`eval $cmd 2>&1`
+ grep 'lp_load_ex: refreshing parameters' $LOG_DIR/log.smbclient
+}
+
+testit "smbclient log-basename" test_smbclient_log_basename || failed=`expr $failed + 1`
+
+testok $0 $failed
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 73bb1a36cd8..2efb21fe8de 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -269,6 +269,9 @@ for env in ["nt4_dc", "nt4_member", "ad_member", "ad_dc", "ad_dc_ntvfs", "s4memb
plantestsuite("samba3.blackbox.smbclient_ntlm.plain NT1", smb1_env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_ntlm.sh"), '$SERVER', '$DC_USERNAME', '$DC_PASSWORD', "never", smbclient3, "NT1", configuration])
plantestsuite("samba3.blackbox.smbclient_ntlm.plain SMB3", env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_ntlm.sh"), '$SERVER', '$DC_USERNAME', '$DC_PASSWORD', "never", smbclient3, "SMB3", configuration])
+
+plantestsuite("samba3.blackbox.smbclient_log_basename", "ad_dc", [os.path.join(samba3srcdir, "script/tests/test_smbclient_log_basename.sh"), '$SERVER', smbclient3, '$PREFIX', configuration])
+
for options in ["--option=clientntlmv2auth=no", "--option=clientusespnego=no --option=clientntlmv2auth=no", "--option=clientusespnego=no --option=clientntlmv2auth=no -mNT1", ""]:
# don't attempt to run SMB1 tests in nt4_member or ad_member
# as these test envs don't support SMB1, use nt4_dc instead
--
Samba Shared Repository
More information about the samba-cvs
mailing list