[SCM] Samba Shared Repository - branch v4-16-stable updated

Jule Anger janger at samba.org
Mon Jul 18 11:17:50 UTC 2022


The branch, v4-16-stable has been updated
       via  b3cbf421c2a VERSION: Disable GIT_SNAPSHOT for the 4.16.3 release.
       via  36eeba73800 WHATSNEW: Add release notes for Samba 4.16.3.
       via  89b914b3c51 s3:winbind: Use the canonical realm name to renew the credentials
       via  e388fe2b701 s3:winbind: Create service principal inside add_ccache_to_list()
       via  c5569b4f7a5 rpc_server3: Initialize mangle_fns in classic and spoolss
       via  17451c5a17a third_party/heimdal: Fix build with gcc version 12.1
       via  3537ef5acbb replace: Check for -Wuse-after-free
       via  52ac4ce2326 nfs4_acls: Correctly skip chown when gid did not change
       via  a708af36656 s3:libads: Check if we have a valid sockaddr
       via  42edafd3ed7 s4:libads: Fix trailing whitespaces in ldap.c
       via  54ad51cd3cc smbd: Make non_widelink_open() robust for non-cwd dirfsp
       via  cce25171f7e s3:printing: Do not clear the printer-list.tdb
       via  becccbae321 s3:waf: Fix version number of public libsmbconf
       via  58bdf100b2b s3: VFS: streams_xattr: Add the same accommodation to streams_xattr_unlinkat() as used in streams_xattr_renameat().
       via  81dc0832eee s3: tests: Add test that shows smbd crashes using vfs_fruit with fruit:resource = stream on deleting a file.
       via  94a94383bbd s3/client: fix dfs deltree, resolve dfs path
       via  659d6140f11 Add test smbclient 'delree' of dir (on DFS share)
       via  8bac5eedc79 s3/client: fix dfs delete, resolve dfs path
       via  2f105c9f541 Add test smbclient 'del' of file (on DFS share)
       via  8db232cb6a0 Add new dfs node msdfs-share pointing to new msdfs-share2
       via  a9f87b9278e s3:utils: Fix missing space in testparm output
       via  edd5a851273 cmdline_s4: re-initialise logging once loadparm is ready
       via  1137957a13b s4/dlz: add support for bind 9.18
       via  959d37e72cc ctdb-daemon: Use DEBUG() macro for child logging
       via  c4e176e46cd ctdb-daemon: Drop unused prefix, logfn, logfn_private
       via  79706765035 ctdb-common: Tell file logging not to redirect stderr
       via  a393eab06a7 util: Add new debug setting debug_no_stderr_redirect
       via  ad60cbaf053 VERSION: Bump version up to Samba 4.16.3...
      from  b1829426413 VERSION: Disable GIT_SNAPSHOT for the 4.16.2 release.

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-16-stable


- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 VERSION                                            |   2 +-
 WHATSNEW.txt                                       |  72 ++++++++-
 ctdb/common/logging.c                              |   1 +
 ctdb/server/ctdb_logging.c                         |  23 +--
 lib/cmdline/cmdline_s4.c                           |  22 ++-
 lib/replace/wscript                                |   3 +
 lib/util/debug.c                                   |   3 +-
 lib/util/debug.h                                   |   1 +
 python/samba/provision/sambadns.py                 |   6 +-
 .../blackbox/smbcacls_dfs_propagate_inherit.py     |   8 -
 selftest/knownfail.d/smb1-tests                    |   2 +
 selftest/target/Samba3.pm                          |  18 +++
 source3/client/client.c                            |  63 ++++++--
 source3/libads/ldap.c                              | 164 +++++++++++----------
 source3/modules/nfs4_acls.c                        |   2 +-
 source3/modules/vfs_streams_xattr.c                |  24 ++-
 source3/printing/printer_list.c                    |  41 ++----
 source3/printing/printer_list.h                    |   2 -
 source3/printing/printing.c                        |   4 -
 source3/rpc_server/rpcd_classic.c                  |   3 +
 source3/rpc_server/rpcd_spoolss.c                  |   3 +
 source3/script/tests/test_fruit_resource_stream.sh |  41 ++++++
 source3/script/tests/test_smbclient_s3.sh          |  95 ++++++++++++
 source3/selftest/tests.py                          |   4 +
 source3/smbd/open.c                                |   3 +-
 source3/utils/testparm.c                           |   3 +-
 source3/winbindd/winbindd_cred_cache.c             |  16 +-
 source3/winbindd/winbindd_pam.c                    |  14 --
 source3/winbindd/winbindd_proto.h                  |   1 -
 source3/wscript_build                              |   2 +-
 source4/dns_server/dlz_minimal.h                   |   3 +
 source4/dns_server/wscript_build                   |  10 ++
 source4/setup/named.conf.dlz                       |   3 +
 third_party/heimdal_build/wscript_build            |  17 ++-
 34 files changed, 491 insertions(+), 188 deletions(-)
 create mode 100755 source3/script/tests/test_fruit_resource_stream.sh


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index e910dbc2a7e..ece0505a714 100644
--- a/VERSION
+++ b/VERSION
@@ -25,7 +25,7 @@
 ########################################################
 SAMBA_VERSION_MAJOR=4
 SAMBA_VERSION_MINOR=16
-SAMBA_VERSION_RELEASE=2
+SAMBA_VERSION_RELEASE=3
 
 ########################################################
 # If a official release has a serious bug              #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index a4727cbf331..f6d5cc5331e 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,3 +1,72 @@
+                   ==============================
+                   Release Notes for Samba 4.16.3
+                           July 18, 2022
+                   ==============================
+
+
+This is the latest stable release of the Samba 4.16 release series.
+
+
+Changes since 4.16.2
+--------------------
+
+o  Jeremy Allison <jra at samba.org>
+   * BUG 15099: Using vfs_streams_xattr and deleting a file causes a panic.
+
+o  Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
+   * BUG 14986: Add support for bind 9.18.
+   * BUG 15076: logging dsdb audit to specific files does not work.
+
+o  Samuel Cabrero <scabrero at samba.org>
+   * BUG 14979: Problem when winbind renews Kerberos.
+   * BUG 15095: Samba with new lorikeet-heimdal fails to build on gcc 12.1 in
+     developer mode.
+
+o  Volker Lendecke <vl at samba.org>
+   * BUG 15105: Crash in streams_xattr because fsp->base_fsp->fsp_name is NULL.
+   * BUG 15118: Crash in rpcd_classic - NULL pointer deference in
+     mangle_is_mangled().
+
+o  Noel Power <noel.power at suse.com>
+   * BUG 15100: smbclient commands del & deltree fail with
+     NT_STATUS_OBJECT_PATH_NOT_FOUND with DFS.
+
+o  Christof Schmitt <cs at samba.org>
+   * BUG 15120: Fix check for chown when processing NFSv4 ACL.
+
+o  Andreas Schneider <asn at samba.org>
+   * BUG 15082: The pcap background queue process should not be stopped.
+   * BUG 15097: testparm: Fix typo in idmap rangesize check.
+   * BUG 15106: net ads info returns LDAP server and LDAP server name as null.
+   * BUG 15108: ldconfig: /lib64/libsmbconf.so.0 is not a symbolic link.
+
+o  Martin Schwenke <martin at meltin.net>
+   * BUG 15090: CTDB child process logging does not work as expected.
+
+
+#######################################
+Reporting bugs & Development Discussion
+#######################################
+
+Please discuss this release on the samba-technical mailing list or by
+joining the #samba-technical:matrix.org matrix room, or
+#samba-technical IRC channel on irc.libera.chat.
+
+If you do report problems then please try to send high quality
+feedback. If you don't provide vital information to help us track down
+the problem then you will probably be ignored.  All bug reports should
+be filed under the Samba 4.1 and newer product in the project's Bugzilla
+database (https://bugzilla.samba.org/).
+
+
+======================================================================
+== Our Code, Our Bugs, Our Responsibility.
+== The Samba Team
+======================================================================
+
+
+Release notes for older releases follow:
+----------------------------------------
                    ==============================
                    Release Notes for Samba 4.16.2
                            June 13, 2022
@@ -66,8 +135,7 @@ database (https://bugzilla.samba.org/).
 ======================================================================
 
 
-Release notes for older releases follow:
-----------------------------------------
+----------------------------------------------------------------------
                    ==============================
                    Release Notes for Samba 4.16.1
                             May 02, 2022
diff --git a/ctdb/common/logging.c b/ctdb/common/logging.c
index 1b91cdcc92b..3aa5ca996ee 100644
--- a/ctdb/common/logging.c
+++ b/ctdb/common/logging.c
@@ -148,6 +148,7 @@ static int file_log_setup(TALLOC_CTX *mem_ctx,
 	struct debug_settings settings = {
 		.debug_syslog_format = true,
 		.debug_hires_timestamp = true,
+		.debug_no_stderr_redirect = true,
 	};
 	const char *t = NULL;
 
diff --git a/ctdb/server/ctdb_logging.c b/ctdb/server/ctdb_logging.c
index 8af787c189f..1da26b5534c 100644
--- a/ctdb/server/ctdb_logging.c
+++ b/ctdb/server/ctdb_logging.c
@@ -38,12 +38,9 @@
 #include "common/logging.h"
 
 struct ctdb_log_state {
-	const char *prefix;
 	int fd, pfd;
 	char buf[1024];
 	uint16_t buf_used;
-	void (*logfn)(const char *, uint16_t, void *);
-	void *logfn_private;
 };
 
 /* Used by ctdb_set_child_logging() */
@@ -68,21 +65,9 @@ bool ctdb_logging_init(TALLOC_CTX *mem_ctx, const char *logging,
 	return true;
 }
 
-/* Note that do_debug always uses the global log state. */
-static void write_to_log(struct ctdb_log_state *log,
-			 const char *buf, unsigned int len)
+static void write_to_log(const char *buf, unsigned int len)
 {
-	if (script_log_level <= DEBUGLEVEL) {
-		if (log != NULL && log->prefix != NULL) {
-			dbgtext("%s: %*.*s\n", log->prefix, len, len, buf);
-		} else {
-			dbgtext("%*.*s\n", len, len, buf);
-		}
-		/* log it in the eventsystem as well */
-		if (log && log->logfn) {
-			log->logfn(log->buf, len, log->logfn_private);
-		}
-	}
+	DEBUG(script_log_level, ("%*.*s\n", len, len, buf));
 }
 
 /*
@@ -119,7 +104,7 @@ static void ctdb_child_log_handler(struct tevent_context *ev,
 		if (n2 > 0 && log->buf[n2-1] == '\r') {
 			n2--;
 		}
-		write_to_log(log, log->buf, n2);
+		write_to_log(log->buf, n2);
 		memmove(log->buf, p+1, sizeof(log->buf) - n1);
 		log->buf_used -= n1;
 	}
@@ -127,7 +112,7 @@ static void ctdb_child_log_handler(struct tevent_context *ev,
 	/* the buffer could have completely filled - unfortunately we have
 	   no choice but to dump it out straight away */
 	if (log->buf_used == sizeof(log->buf)) {
-		write_to_log(log, log->buf, log->buf_used);
+		write_to_log(log->buf, log->buf_used);
 		log->buf_used = 0;
 	}
 }
diff --git a/lib/cmdline/cmdline_s4.c b/lib/cmdline/cmdline_s4.c
index 29e9f34bbe2..f8be4ed670c 100644
--- a/lib/cmdline/cmdline_s4.c
+++ b/lib/cmdline/cmdline_s4.c
@@ -31,6 +31,8 @@ static bool _samba_cmdline_load_config_s4(void)
 {
 	struct loadparm_context *lp_ctx = samba_cmdline_get_lp_ctx();
 	const char *config_file = NULL;
+	const struct samba_cmdline_daemon_cfg *cmdline_daemon_cfg = \
+		samba_cmdline_get_daemon_cfg();
 	bool ok;
 
 	/* Load smb conf */
@@ -45,15 +47,11 @@ static bool _samba_cmdline_load_config_s4(void)
 	}
 
 	switch (_config_type) {
-	case SAMBA_CMDLINE_CONFIG_SERVER: {
-		const struct samba_cmdline_daemon_cfg *cmdline_daemon_cfg =
-			samba_cmdline_get_daemon_cfg();
-
+	case SAMBA_CMDLINE_CONFIG_SERVER:
 		if (!cmdline_daemon_cfg->interactive) {
 			setup_logging(getprogname(), DEBUG_FILE);
 		}
 		break;
-	}
 	default:
 		break;
 	}
@@ -70,6 +68,20 @@ static bool _samba_cmdline_load_config_s4(void)
 		}
 	}
 
+	switch (_config_type) {
+	case SAMBA_CMDLINE_CONFIG_SERVER:
+		/*
+		 * We need to setup_logging *again* to ensure multi-file
+		 * logging is set up as specified in smb.conf.
+		 */
+		if (!cmdline_daemon_cfg->interactive) {
+			setup_logging(getprogname(), DEBUG_FILE);
+		}
+		break;
+	default:
+		break;
+	}
+
 	return true;
 }
 
diff --git a/lib/replace/wscript b/lib/replace/wscript
index e60ff15f903..e4c2d513076 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -128,6 +128,9 @@ def configure(conf):
     if conf.CHECK_CFLAGS('-Wno-strict-overflow'):
         conf.define('HAVE_WNO_STRICT_OVERFLOW', '1')
 
+    if conf.CHECK_CFLAGS('-Wuse-after-free=1'):
+        conf.define('HAVE_WUSE_AFTER_FREE_1', '1')
+
     # Check for process set name support
     conf.CHECK_CODE('''
                     #include <sys/prctl.h>
diff --git a/lib/util/debug.c b/lib/util/debug.c
index 784357e9370..3cd577dc0eb 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -1315,7 +1315,8 @@ bool reopen_logs_internal(void)
 	 * If log file was opened or created successfully, take over stderr to
 	 * catch output into logs.
 	 */
-	if (dbgc_config[DBGC_ALL].fd > 0) {
+	if (!state.settings.debug_no_stderr_redirect &&
+	    dbgc_config[DBGC_ALL].fd > 0) {
 		if (dup2(dbgc_config[DBGC_ALL].fd, 2) == -1) {
 			/* Close stderr too, if dup2 can't point it -
 			   at the logfile.  There really isn't much
diff --git a/lib/util/debug.h b/lib/util/debug.h
index 7317c2f43c5..34b63a24478 100644
--- a/lib/util/debug.h
+++ b/lib/util/debug.h
@@ -304,6 +304,7 @@ struct debug_settings {
 	bool debug_pid;
 	bool debug_uid;
 	bool debug_class;
+	bool debug_no_stderr_redirect;
 };
 
 void setup_logging(const char *prog_name, enum debug_logtype new_logtype);
diff --git a/python/samba/provision/sambadns.py b/python/samba/provision/sambadns.py
index 6823f9ee56b..404b346a885 100644
--- a/python/samba/provision/sambadns.py
+++ b/python/samba/provision/sambadns.py
@@ -1017,6 +1017,7 @@ def create_named_conf(paths, realm, dnsdomain, dns_backend, logger):
         bind9_12 = '#'
         bind9_14 = '#'
         bind9_16 = '#'
+        bind9_18 = '#'
         if bind_info.upper().find('BIND 9.8') != -1:
             bind9_8 = ''
         elif bind_info.upper().find('BIND 9.9') != -1:
@@ -1031,6 +1032,8 @@ def create_named_conf(paths, realm, dnsdomain, dns_backend, logger):
             bind9_14 = ''
         elif bind_info.upper().find('BIND 9.16') != -1:
             bind9_16 = ''
+        elif bind_info.upper().find('BIND 9.18') != -1:
+            bind9_18 = ''
         elif bind_info.upper().find('BIND 9.7') != -1:
             raise ProvisioningError("DLZ option incompatible with BIND 9.7.")
         elif bind_info.upper().find('BIND_9.13') != -1:
@@ -1050,7 +1053,8 @@ def create_named_conf(paths, realm, dnsdomain, dns_backend, logger):
                     "BIND9_11": bind9_11,
                     "BIND9_12": bind9_12,
                     "BIND9_14": bind9_14,
-                    "BIND9_16": bind9_16
+                    "BIND9_16": bind9_16,
+                    "BIND9_18": bind9_18
                     })
 
 
diff --git a/python/samba/tests/blackbox/smbcacls_dfs_propagate_inherit.py b/python/samba/tests/blackbox/smbcacls_dfs_propagate_inherit.py
index 36c29c8ccca..42680df0d06 100644
--- a/python/samba/tests/blackbox/smbcacls_dfs_propagate_inherit.py
+++ b/python/samba/tests/blackbox/smbcacls_dfs_propagate_inherit.py
@@ -85,11 +85,3 @@ class DfsInheritanceSmbCaclsTests(InheritanceSmbCaclsTests):
 
     def tearDown(self):
         super(DfsInheritanceSmbCaclsTests, self).tearDown()
-        # for dfs tests inevitably we fallback to remove the local files in
-        # the base class, the base class however doesn't know about the
-        # target dfs share (or its contents) so we have to assume we need to
-        # remove the file on the dfs share
-        smbclient_args = self.build_test_cmd("smbclient", ["//%s/%s" % (self.server, self.dfs_target_share), "-c", "rm file-3"])
-        self.check_output(smbclient_args)
-
-
diff --git a/selftest/knownfail.d/smb1-tests b/selftest/knownfail.d/smb1-tests
index 03d299ad7c7..b5263f28016 100644
--- a/selftest/knownfail.d/smb1-tests
+++ b/selftest/knownfail.d/smb1-tests
@@ -10,6 +10,8 @@
 ^samba3.blackbox.smbclient_s3.NT1.(plain|sign).member_creds.interactive smbclient -l prompts on stdout\((ad_member|nt4_member)\)
 ^samba3.blackbox.smbclient_s3.NT1.(plain|sign).member_creds.creating a bad symlink and deleting it\((ad_member|nt4_member)\)
 ^samba3.blackbox.smbclient_s3.NT1.(plain|sign).member_creds.Accessing an MS-DFS link\((ad_member|nt4_member)\)
+^samba3.blackbox.smbclient_s3.NT1.(plain|sign).member_creds.del on MS-DFS share\((ad_member|nt4_member)\)
+^samba3.blackbox.smbclient_s3.NT1.(plain|sign).member_creds.deltree on MS-DFS share\((ad_member|nt4_member)\)
 ^samba3.blackbox.smbclient_s3.NT1.(plain|sign).member_creds.Ensure archive bit is set correctly on file/dir rename\((ad_member|nt4_member)\)
 ^samba3.blackbox.smbclient_s3.NT1.(plain|sign).member_creds.ccache access works for smbclient\((ad_member|nt4_member)\)
 ^samba3.blackbox.smbclient_s3.NT1.(plain|sign).member_creds.using an authentication file\((ad_member|nt4_member)\)
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index b260f26cbc0..595be223dce 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -2415,6 +2415,9 @@ sub provision($$)
 	my $msdfs_shrdir="$shrdir/msdfsshare";
 	push(@dirs,$msdfs_shrdir);
 
+	my $msdfs_shrdir2="$shrdir/msdfsshare2";
+	push(@dirs,$msdfs_shrdir2);
+
 	my $msdfs_deeppath="$msdfs_shrdir/deeppath";
 	push(@dirs,$msdfs_deeppath);
 
@@ -2460,6 +2463,9 @@ sub provision($$)
 	my $local_symlinks_shrdir="$shrdir/local_symlinks";
 	push(@dirs,$local_symlinks_shrdir);
 
+	my $fruit_resource_stream_shrdir="$shrdir/fruit_resource_stream";
+	push(@dirs,$fruit_resource_stream_shrdir);
+
 	# this gets autocreated by winbindd
 	my $wbsockdir="$prefix_abs/wbsock";
 
@@ -2508,6 +2514,8 @@ sub provision($$)
 	symlink "msdfs:$server_ip\\smbcacls_sharedir_dfs,$server_ipv6\\smbcacls_sharedir_dfs",
 		"$msdfs_shrdir/smbcacls_sharedir_dfs";
 
+	symlink "msdfs:$server_ip\\msdfs-share2,$server_ipv6\\msdfs-share2", "$msdfs_shrdir/dfshop1";
+	symlink "msdfs:$server_ip\\tmp,$server_ipv6\\tmp", "$msdfs_shrdir2/dfshop2";
 	##
 	## create bad names in $badnames_shrdir
 	##
@@ -2831,6 +2839,10 @@ sub provision($$)
 	msdfs root = yes
 	msdfs shuffle referrals = yes
 	guest ok = yes
+[msdfs-share2]
+	path = $msdfs_shrdir2
+	msdfs root = yes
+	guest ok = yes
 [hideunread]
 	copy = tmp
 	hide unreadable = yes
@@ -3014,6 +3026,12 @@ sub provision($$)
 	fruit:metadata = stream
 	fruit:zero_file_id=yes
 
+[fruit_resource_stream]
+	path = $fruit_resource_stream_shrdir
+	vfs objects = fruit streams_xattr acl_xattr xattr_tdb
+	fruit:resource = stream
+	fruit:metadata = stream
+
 [badname-tmp]
 	path = $badnames_shrdir
 	guest ok = yes
diff --git a/source3/client/client.c b/source3/client/client.c
index 8ec4589a1cd..69b7c9022c2 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -2354,6 +2354,9 @@ static NTSTATUS do_del(struct cli_state *cli_state, struct file_info *finfo,
 {
 	TALLOC_CTX *ctx = talloc_tos();
 	char *mask = NULL;
+	struct cli_state *targetcli = NULL;
+	char *targetname = NULL;
+	struct cli_credentials *creds = samba_cmdline_get_creds();
 	NTSTATUS status;
 
 	mask = talloc_asprintf(ctx,
@@ -2370,7 +2373,15 @@ static NTSTATUS do_del(struct cli_state *cli_state, struct file_info *finfo,
 		return NT_STATUS_OK;
 	}
 
-	status = cli_unlink(cli_state, mask, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
+	status = cli_resolve_path(ctx, "",
+				  creds,
+				cli, mask, &targetcli, &targetname);
+	if (!NT_STATUS_IS_OK(status)) {
+		goto out;
+	}
+
+	status = cli_unlink(targetcli, targetname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
+out:
 	if (!NT_STATUS_IS_OK(status)) {
 		d_printf("%s deleting remote file %s\n",
 			 nt_errstr(status), mask);
@@ -2428,20 +2439,37 @@ static NTSTATUS delete_remote_files_list(struct cli_state *cli_state,
 {
 	NTSTATUS status = NT_STATUS_OK;
 	struct file_list *deltree_list_iter = NULL;
+	char *targetname = NULL;
+	struct cli_state *targetcli = NULL;
+	struct cli_credentials *creds = samba_cmdline_get_creds();
+	TALLOC_CTX *ctx = talloc_tos();
 
 	for (deltree_list_iter = flist;
 			deltree_list_iter != NULL;
 			deltree_list_iter = deltree_list_iter->next) {
+		status = cli_resolve_path(ctx,
+				"",
+				creds,
+				cli_state,
+				deltree_list_iter->file_path,
+				&targetcli,
+				&targetname);
+		if (!NT_STATUS_IS_OK(status)) {
+			d_printf("delete_remote_files %s: %s\n",
+				deltree_list_iter->file_path,
+				nt_errstr(status));
+			return status;
+		}
 		if (CLI_DIRSEP_CHAR == '/') {
 			/* POSIX. */
-			status = cli_posix_unlink(cli_state,
-					deltree_list_iter->file_path);
+			status = cli_posix_unlink(targetcli,
+					targetname);
 		} else if (deltree_list_iter->isdir) {
-			status = cli_rmdir(cli_state,
-					deltree_list_iter->file_path);
+			status = cli_rmdir(targetcli,
+					targetname);
 		} else {
-			status = cli_unlink(cli_state,
-					deltree_list_iter->file_path,
+			status = cli_unlink(targetcli,
+					targetname,
 					FILE_ATTRIBUTE_SYSTEM |
 					FILE_ATTRIBUTE_HIDDEN);
 		}
@@ -2550,14 +2578,27 @@ static int cmd_deltree(void)
 	     deltree_list_iter = deltree_list_iter->next) {
 
 		if (deltree_list_iter->isdir == false) {
+			char *targetname = NULL;
+			struct cli_state *targetcli = NULL;
+			struct cli_credentials *creds = samba_cmdline_get_creds();
+			status = cli_resolve_path(ctx,
+						"",
+						creds,
+						cli,
+						deltree_list_iter->file_path,
+						&targetcli,
+						&targetname);
+			if (!NT_STATUS_IS_OK(status)) {
+				goto err;
+			}
 			/* Just a regular file. */
 			if (CLI_DIRSEP_CHAR == '/') {
 				/* POSIX. */
-				status = cli_posix_unlink(cli,
-					deltree_list_iter->file_path);
+				status = cli_posix_unlink(targetcli,
+					targetname);
 			} else {
-				status = cli_unlink(cli,
-					deltree_list_iter->file_path,
+				status = cli_unlink(targetcli,
+					targetname,
 					FILE_ATTRIBUTE_SYSTEM |
 					FILE_ATTRIBUTE_HIDDEN);
 			}
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 6caeebe6037..f1a1e036050 100755
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -1,4 +1,4 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    ads (active directory) utility library
    Copyright (C) Andrew Tridgell 2001
@@ -41,7 +41,7 @@
  *
  * The routines contained here should do the necessary ldap calls for
  * ads setups.


-- 
Samba Shared Repository



More information about the samba-cvs mailing list