[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Thu Dec 22 10:53:02 UTC 2022


The branch, master has been updated
       via  9c707b4be27 s3:client: Fix a use-after-free issue in smbclient
       via  0d1961267cd s3:script: Improve test_chdir_cache.sh
       via  a4ba6fa4c88 autobuild: Don't use deprecated distutils
      from  429bf5ce231 third_party: Update resolv_wrapper to version 1.1.8

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 9c707b4be27e2a6f79886d3ec8b5066c922b99bd
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 22 10:31:11 2022 +0100

    s3:client: Fix a use-after-free issue in smbclient
    
    Detected by
    
        make test TESTS="samba3.blackbox.chdir-cache"
    
    with an optimized build or with AddressSanitizer.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15268
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Thu Dec 22 10:52:31 UTC 2022 on sn-devel-184

commit 0d1961267cd9e8f1158a407c5d135514c363f37e
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 22 10:36:02 2022 +0100

    s3:script: Improve test_chdir_cache.sh
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15268
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit a4ba6fa4c88225d1095189809a51dbdd94c538dc
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Dec 21 16:02:18 2022 +0100

    autobuild: Don't use deprecated distutils
    
    The distutils package was deprecated in Python 3.10 by PEP 632.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 script/autobuild.py                      |  8 ++++++--
 source3/client/client.c                  |  5 +++--
 source3/script/tests/test_chdir_cache.sh | 12 ++++++++----
 3 files changed, 17 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/script/autobuild.py b/script/autobuild.py
index 7b34c2d6b28..afa757491e0 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -16,7 +16,7 @@ from email.mime.text import MIMEText
 from email.mime.base import MIMEBase
 from email.mime.application import MIMEApplication
 from email.mime.multipart import MIMEMultipart
-from distutils.sysconfig import get_python_lib
+from sysconfig import get_path
 import platform
 
 try:
@@ -1298,7 +1298,11 @@ class builder(object):
             do_print('%s: Remaining consumers %u' % (self.name, len(self.consumers)))
             return
         (self.stage, self.cmd) = self.sequence[self.next]
-        self.cmd = self.cmd.replace("${PYTHON_PREFIX}", get_python_lib(plat_specific=1, standard_lib=0, prefix=self.prefix))
+        self.cmd = self.cmd.replace("${PYTHON_PREFIX}",
+                                    get_path(name='platlib',
+                                             scheme="posix_prefix",
+                                             vars={"base": self.prefix,
+                                                   "platbase": self.prefix}))
         self.cmd = self.cmd.replace("${PREFIX}", "--prefix=%s" % self.prefix)
         self.cmd = self.cmd.replace("${PREFIX_DIR}", "%s" % self.prefix)
         self.cmd = self.cmd.replace("${TESTS}", options.restrict_tests)
diff --git a/source3/client/client.c b/source3/client/client.c
index f7719db118b..8e29224918d 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -5118,10 +5118,11 @@ static int cmd_tcon(void)
 		return -1;
 	}
 
-	talloc_free(sharename);
-
 	d_printf("tcon to %s successful, tid: %u\n", sharename,
 		 cli_state_get_tid(cli));
+
+	talloc_free(sharename);
+
 	return 0;
 }
 
diff --git a/source3/script/tests/test_chdir_cache.sh b/source3/script/tests/test_chdir_cache.sh
index ae244acdd58..c649d2b07b3 100755
--- a/source3/script/tests/test_chdir_cache.sh
+++ b/source3/script/tests/test_chdir_cache.sh
@@ -33,7 +33,7 @@ conf_dir=$(dirname ${SERVERCONFFILE})
 log_file=${conf_dir}/../smbd_test.log
 
 error_inject_conf=${conf_dir}/error_inject.conf
->${error_inject_conf}
+rm -f ${error_inject_conf}
 
 incdir=$(dirname $0)/../../../testprogs/blackbox
 . $incdir/subunit.sh
@@ -80,7 +80,9 @@ head -n 4 <&101
 
 # Ensure any chdir will give EACCESS.
 echo "error_inject:chdir = EACCES" >${error_inject_conf}
-${SMBCONTROL} ${CONF} 0 reload-config
+testit "reload config 1" \
+	"${SMBCONTROL}" "${CONF}" smbd reload-config ||
+	failed=$((failed + 1))
 
 sleep 1
 
@@ -94,8 +96,10 @@ kill ${CLIENT_PID}
 rm -f smbclient-stdin smbclient-stdout smbclient-stderr
 
 # Remove the chdir inject.
->${error_inject_conf}
-${SMBCONTROL} ${CONF} 0 reload-config
+rm -f ${error_inject_conf}
+testit "reload config 2" \
+	"${SMBCONTROL}" "${CONF}" smbd reload-config ||
+	failed=$((failed + 1))
 
 # Now look for chdir_current_service: vfs_ChDir.*failed: Permission denied
 # in the smb log. There should be one more than before.


-- 
Samba Shared Repository



More information about the samba-cvs mailing list