[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Sep 14 16:44:02 MDT 2011


The branch, master has been updated
       via  cc6f023 Finish commit 8745c70d by Michael Adam.
       via  ff52be0 s3:libsmb: remove unused cli->is_samba
       via  3c6808d s3:libsmb: align chunk_size for cli_pull/push() to a page size of 1024 bytes
       via  73cc454 s3:client.h: remove unused defines
       via  6626c83 s3:libsmb: let cli_write_max_bufsize() return the max number of possible bytes
       via  4c9b184 s3:libsmb: let cli_read_max_bufsize() return the max number of possible bytes
       via  f8c26c1 s3:smbd: SMB ReadX with size > 0xffff should only possible for samba clients.
       via  555c626 s3:smbd: remember the client unix capabilities on the connection
       via  f261ac1 Fix bug #8453 - smbclient segfaults when dialect option -m is used for legacy dialects
      from  d727fcc libcli/auth: add some const to SMBNTencrypt_hash() and SMBNTencrypt()

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


- Log -----------------------------------------------------------------
commit cc6f0231c9e75e88ab68dc97596a040b3f008791
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Sep 14 14:07:29 2011 -0700

    Finish commit 8745c70d by Michael Adam.
    
    If you're going to move winbindd_cache.tdb to the state_path, do it *everywhere*.
    
    Found by Ira Cooper <ira at wakeful.net>.
    
    Autobuild-User: Jeremy Allison <jra at samba.org>
    Autobuild-Date: Thu Sep 15 00:43:04 CEST 2011 on sn-devel-104

commit ff52be06e5c5581fe4acf6dc4f5a5e60ddbc8f52
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Sep 12 03:19:35 2011 +0200

    s3:libsmb: remove unused cli->is_samba
    
    s3:libsmb: remove unused cli->is_samba
    
    metze
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 3c6808d5ed4aee60f7c7ca242e64abf291fff110
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Sep 12 02:48:25 2011 +0200

    s3:libsmb: align chunk_size for cli_pull/push() to a page size of 1024 bytes
    
    s3:libsmb: align chunk_size for cli_pull/push() to a page size of 1024 bytes
    
    metze
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 73cc454af07f8e80d4f88730e492a5d1cf97f260
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Sep 13 09:58:34 2011 +0200

    s3:client.h: remove unused defines
    
    s3:client.h: remove unused defines
    
    metze
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 6626c836f353ad2e574621a44bc9a74658cceb62
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Sep 12 02:45:22 2011 +0200

    s3:libsmb: let cli_write_max_bufsize() return the max number of possible bytes
    
    s3:libsmb: let cli_write_max_bufsize() return the max number of possible bytes
    
    We now return what's possible on the wire.
    
    Which is 0x1FFFF - data_offset if CAP_LARGE_WRITEX is given by
    the server (without signing) or 0xFFFFFF - data_offset
    if CIFS_UNIX_LARGE_READ_CAP is available (without signing/sealing).
    Otherwise we return max_xmit - data_offset.
    
    metze
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 4c9b1841ed41df0b4084447ffcbfeb470679105f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Sep 12 02:45:22 2011 +0200

    s3:libsmb: let cli_read_max_bufsize() return the max number of possible bytes
    
    s3:libsmb: let cli_read_max_bufsize() return the max number of possible bytes
    
    We now return what's possible on the wire.
    
    Which is 0xFFFF if CAP_LARGE_READX is given by the server
    or 0xFFFFFF - data_offset if CIFS_UNIX_LARGE_READ_CAP
    is available (without signing/sealing). Otherwise we return
    max_xmit - data_offset.
    
    metze
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit f8c26c16b82989e002b839fc9eba6386fc036f6a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sat Sep 10 11:02:02 2011 +0200

    s3:smbd: SMB ReadX with size > 0xffff should only possible for samba clients.
    
    Windows 2008 R2 (and others) ignore the high bits for the read size.
    
    Unless we're using the unix extentions and the client
    uses CIFS_UNIX_LARGE_READ_CAP, we should also ignore
    the high bits.
    
    But we still need to support old "smbclient" binaries
    and have to check if the client is "Samba".
    
    metze
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 555c626af83a2dc7bc81f012dd93d73045a3428f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Sep 12 05:12:50 2011 +0200

    s3:smbd: remember the client unix capabilities on the connection
    
    metze
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit f261ac1932ecdae925b27301aa3e907757845a85
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Sep 14 11:59:22 2011 -0700

    Fix bug #8453 - smbclient segfaults when dialect option -m is used for legacy dialects
    
    Ensure we have valid pointers.

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

Summary of changes:
 source3/include/client.h          |   10 ----
 source3/libsmb/cliconnect.c       |   36 +++++--------
 source3/libsmb/clireadwrite.c     |  104 ++++++++++++++++++++++++-------------
 source3/smbd/globals.h            |    7 +++
 source3/smbd/reply.c              |   11 ++++-
 source3/smbd/trans2.c             |   80 +++++++++++++---------------
 source3/torture/torture.c         |    8 ---
 source3/utils/smbcontrol.c        |    8 ++--
 source3/winbindd/winbindd_cache.c |   10 ++--
 9 files changed, 144 insertions(+), 130 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/client.h b/source3/include/client.h
index 7c039ae..37dbf02 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -22,16 +22,7 @@
 #ifndef _CLIENT_H
 #define _CLIENT_H
 
-/* the client asks for a smaller buffer to save ram and also to get more
-   overlap on the wire. This size gives us a nice read/write size, which
-   will be a multiple of the page size on almost any system */
 #define CLI_BUFFER_SIZE (0xFFFF)
-#define CLI_SAMBA_MAX_LARGE_READX_SIZE (127*1024) /* Works for Samba servers */
-#define CLI_SAMBA_MAX_LARGE_WRITEX_SIZE (127*1024) /* Works for Samba servers */
-#define CLI_WINDOWS_MAX_LARGE_READX_SIZE ((64*1024)-2) /* Windows servers are broken.... */
-#define CLI_WINDOWS_MAX_LARGE_WRITEX_SIZE ((64*1024)-2) /* Windows servers are broken.... */
-#define CLI_SAMBA_MAX_POSIX_LARGE_READX_SIZE (0xFFFF00) /* 24-bit len. */
-#define CLI_SAMBA_MAX_POSIX_LARGE_WRITEX_SIZE (0xFFFF00) /* 24-bit len. */
 
 /*
  * These definitions depend on smb.h
@@ -84,7 +75,6 @@ struct cli_state {
 	size_t max_mux;
 	int initialised;
 	int win95;
-	bool is_samba;
 	bool is_guestlogin;
 	uint32 capabilities;
 	/* What the server offered. */
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 54cd669..d439155 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -317,9 +317,6 @@ static void cli_session_setup_lanman2_done(struct tevent_req *subreq)
 	}
 	p += ret;
 
-	if (strstr(cli->server_type, "Samba")) {
-		cli->is_samba = True;
-	}
 	status = cli_set_username(cli, state->user);
 	if (tevent_req_nterror(req, status)) {
 		return;
@@ -545,10 +542,6 @@ static void cli_session_setup_guest_done(struct tevent_req *subreq)
 	}
 	p += ret;
 
-	if (strstr(cli->server_type, "Samba")) {
-		cli->is_samba = True;
-	}
-
 	status = cli_set_username(cli, "");
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
@@ -756,9 +749,7 @@ static void cli_session_setup_plain_done(struct tevent_req *subreq)
 	if (tevent_req_nterror(req, status)) {
 		return;
 	}
-	if (strstr(cli->server_type, "Samba")) {
-		cli->is_samba = True;
-	}
+
 	tevent_req_done(req);
 }
 
@@ -1105,10 +1096,6 @@ static void cli_session_setup_nt1_done(struct tevent_req *subreq)
 	}
 	p += ret;
 
-	if (strstr(cli->server_type, "Samba")) {
-		cli->is_samba = True;
-	}
-
 	status = cli_set_username(cli, state->user);
 	if (tevent_req_nterror(req, status)) {
 		return;
@@ -1358,10 +1345,6 @@ static void cli_sesssetup_blob_done(struct tevent_req *subreq)
 	}
 	p += ret;
 
-	if (strstr(cli->server_type, "Samba")) {
-		cli->is_samba = True;
-	}
-
 	if (state->blob.length != 0) {
 		/*
 		 * More to send
@@ -1997,6 +1980,19 @@ NTSTATUS cli_session_setup(struct cli_state *cli,
 	}
 
 	if (cli_state_protocol(cli) < PROTOCOL_LANMAN1) {
+		/*
+		 * Ensure cli->server_domain,
+		 * cli->server_os and cli->server_type
+		 * are valid pointers.
+		 */
+		cli->server_domain = talloc_strdup(cli, "");
+		cli->server_os = talloc_strdup(cli, "");
+		cli->server_type = talloc_strdup(cli, "");
+		if (cli->server_domain == NULL ||
+				cli->server_os == NULL ||
+				cli->server_type == NULL) {
+			return NT_STATUS_NO_MEMORY;
+		}
 		return NT_STATUS_OK;
 	}
 
@@ -2073,10 +2069,6 @@ NTSTATUS cli_session_setup(struct cli_state *cli,
 		}
 	}
 
-	if (strstr(cli->server_type, "Samba")) {
-		cli->is_samba = True;
-	}
-
 	return NT_STATUS_OK;
 }
 
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index cd73252..bbe6a81 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -28,27 +28,42 @@
 ****************************************************************************/
 static size_t cli_read_max_bufsize(struct cli_state *cli)
 {
-	size_t data_offset = smb_size - 4;
-	size_t wct = 12;
-
-	size_t useable_space;
-
-	if (!client_is_signing_on(cli) && !cli_encryption_on(cli)
-	    && (cli->server_posix_capabilities & CIFS_UNIX_LARGE_READ_CAP)) {
-		return CLI_SAMBA_MAX_POSIX_LARGE_READX_SIZE;
-	}
-	if (cli_state_capabilities(cli) & CAP_LARGE_READX) {
-		return cli->is_samba
-			? CLI_SAMBA_MAX_LARGE_READX_SIZE
-			: CLI_WINDOWS_MAX_LARGE_READX_SIZE;
-	}
+	uint8_t wct = 12;
+	uint32_t min_space;
+	uint32_t data_offset;
+	uint32_t useable_space = 0;
 
+	data_offset = HDR_VWV;
 	data_offset += wct * sizeof(uint16_t);
+	data_offset += sizeof(uint16_t); /* byte count */
 	data_offset += 1; /* pad */
 
-	useable_space = cli_state_available_size(cli, data_offset);
+	min_space = cli_state_available_size(cli, data_offset);
 
-	return useable_space;
+	if (cli->server_posix_capabilities & CIFS_UNIX_LARGE_READ_CAP) {
+		useable_space = 0xFFFFFF - data_offset;
+
+		if (client_is_signing_on(cli)) {
+			return min_space;
+		}
+
+		if (cli_encryption_on(cli)) {
+			return min_space;
+		}
+
+		return useable_space;
+	} else if (cli_state_capabilities(cli) & CAP_LARGE_READX) {
+		/*
+		 * Note: CAP_LARGE_READX also works with signing
+		 */
+		useable_space = 0x1FFFF - data_offset;
+
+		useable_space = MIN(useable_space, UINT16_MAX);
+
+		return useable_space;
+	}
+
+	return min_space;
 }
 
 /****************************************************************************
@@ -58,35 +73,42 @@ static size_t cli_write_max_bufsize(struct cli_state *cli,
 				    uint16_t write_mode,
 				    uint8_t wct)
 {
-        if (write_mode == 0 &&
-	    !client_is_signing_on(cli) &&
-	    !cli_encryption_on(cli) &&
-	    (cli->server_posix_capabilities & CIFS_UNIX_LARGE_WRITE_CAP) &&
-	    (cli_state_capabilities(cli) & CAP_LARGE_FILES)) {
-		/* Only do massive writes if we can do them direct
-		 * with no signing or encrypting - not on a pipe. */
-		return CLI_SAMBA_MAX_POSIX_LARGE_WRITEX_SIZE;
-	}
+	uint32_t min_space;
+	uint32_t data_offset;
+	uint32_t useable_space = 0;
+
+	data_offset = HDR_VWV;
+	data_offset += wct * sizeof(uint16_t);
+	data_offset += sizeof(uint16_t); /* byte count */
+	data_offset += 1; /* pad */
+
+	min_space = cli_state_available_size(cli, data_offset);
 
-	if (cli->is_samba) {
-		return CLI_SAMBA_MAX_LARGE_WRITEX_SIZE;
+	if (cli->server_posix_capabilities & CIFS_UNIX_LARGE_WRITE_CAP) {
+		useable_space = 0xFFFFFF - data_offset;
+	} else if (cli_state_capabilities(cli) & CAP_LARGE_WRITEX) {
+		useable_space = 0x1FFFF - data_offset;
+	} else {
+		return min_space;
 	}
 
-	if (((cli_state_capabilities(cli) & CAP_LARGE_WRITEX) == 0)
-	    || client_is_signing_on(cli)
-	    || strequal(cli->dev, "LPT1:")) {
-		size_t data_offset = smb_size - 4;
-		size_t useable_space;
+	if (write_mode != 0) {
+		return min_space;
+	}
 
-		data_offset += wct * sizeof(uint16_t);
-		data_offset += 1; /* pad */
+	if (client_is_signing_on(cli)) {
+		return min_space;
+	}
 
-		useable_space = cli_state_available_size(cli, data_offset);
+	if (cli_encryption_on(cli)) {
+		return min_space;
+	}
 
-		return useable_space;
+	if (strequal(cli->dev, "LPT1:")) {
+		return min_space;
 	}
 
-	return CLI_WINDOWS_MAX_LARGE_WRITEX_SIZE;
+	return useable_space;
 }
 
 struct cli_read_andx_state {
@@ -454,6 +476,7 @@ struct tevent_req *cli_pull_send(TALLOC_CTX *mem_ctx,
 	struct tevent_req *req;
 	struct cli_pull_state *state;
 	int i;
+	size_t page_size = 1024;
 
 	req = tevent_req_create(mem_ctx, &state, struct cli_pull_state);
 	if (req == NULL) {
@@ -479,6 +502,9 @@ struct tevent_req *cli_pull_send(TALLOC_CTX *mem_ctx,
 	}
 
 	state->chunk_size = cli_read_max_bufsize(cli);
+	if (state->chunk_size > page_size) {
+		state->chunk_size &= ~(page_size - 1);
+	}
 
 	state->max_reqs = cli_state_max_requests(cli);
 
@@ -1149,6 +1175,7 @@ struct tevent_req *cli_push_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
 	struct tevent_req *req;
 	struct cli_push_state *state;
 	uint32_t i;
+	size_t page_size = 1024;
 
 	req = tevent_req_create(mem_ctx, &state, struct cli_push_state);
 	if (req == NULL) {
@@ -1166,6 +1193,9 @@ struct tevent_req *cli_push_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
 	state->next_offset = start_offset;
 
 	state->chunk_size = cli_write_max_bufsize(cli, mode, 14);
+	if (state->chunk_size > page_size) {
+		state->chunk_size &= ~(page_size - 1);
+	}
 
 	state->max_reqs = cli_state_max_requests(cli);
 
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index 92532c2..4d95453 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -532,6 +532,13 @@ struct smbd_server_connection {
 		} negprot;
 
 		struct {
+			uint16_t client_major;
+			uint16_t client_minor;
+			uint32_t client_cap_low;
+			uint32_t client_cap_high;
+		} unix_info;
+
+		struct {
 			bool done_sesssetup;
 			/*
 			 * Size of data we can send to client. Set
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 6f2f281..0adc4e8 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -3738,6 +3738,7 @@ nosendfile_read:
 
 void reply_read_and_X(struct smb_request *req)
 {
+	struct smbd_server_connection *sconn = req->sconn;
 	connection_struct *conn = req->conn;
 	files_struct *fsp;
 	SMB_OFF_T startpos;
@@ -3776,7 +3777,15 @@ void reply_read_and_X(struct smb_request *req)
 		return;
 	}
 
-	if (global_client_caps & CAP_LARGE_READX) {
+	if ((sconn->smb1.unix_info.client_cap_low & CIFS_UNIX_LARGE_READ_CAP) ||
+	    (get_remote_arch() == RA_SAMBA)) {
+		/*
+		 * This is Samba only behavior (up to Samba 3.6)!
+		 *
+		 * Windows 2008 R2 ignores the upper_size,
+		 * so we do unless unix extentions are active
+		 * or "smbclient" is talking to us.
+		 */
 		size_t upper_size = SVAL(req->vwv+7, 0);
 		smb_maxcnt |= (upper_size<<16);
 		if (upper_size > 1) {
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 881dced..8d34828 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -3539,6 +3539,7 @@ static void call_trans2setfsinfo(connection_struct *conn,
 				 char **ppdata, int total_data,
 				 unsigned int max_data_bytes)
 {
+	struct smbd_server_connection *sconn = req->sconn;
 	char *pdata = *ppdata;
 	char *params = *pparams;
 	uint16 info_level;
@@ -3579,54 +3580,47 @@ static void call_trans2setfsinfo(connection_struct *conn,
 
 	switch(info_level) {
 		case SMB_SET_CIFS_UNIX_INFO:
-			{
-				uint16 client_unix_major;
-				uint16 client_unix_minor;
-				uint32 client_unix_cap_low;
-				uint32 client_unix_cap_high;
-
-				if (!lp_unix_extensions()) {
-					reply_nterror(req,
-						      NT_STATUS_INVALID_LEVEL);
-					return;
-				}
+			if (!lp_unix_extensions()) {
+				reply_nterror(req,
+					      NT_STATUS_INVALID_LEVEL);
+				return;
+			}
 
-				/* There should be 12 bytes of capabilities set. */
-				if (total_data < 8) {
-					reply_nterror(
-						req,
-						NT_STATUS_INVALID_PARAMETER);
-					return;
-				}
-				client_unix_major = SVAL(pdata,0);
-				client_unix_minor = SVAL(pdata,2);
-				client_unix_cap_low = IVAL(pdata,4);
-				client_unix_cap_high = IVAL(pdata,8);
-				/* Just print these values for now. */
-				DEBUG(10,("call_trans2setfsinfo: set unix info. major = %u, minor = %u \
-cap_low = 0x%x, cap_high = 0x%x\n",
-					(unsigned int)client_unix_major,
-					(unsigned int)client_unix_minor,
-					(unsigned int)client_unix_cap_low,
-					(unsigned int)client_unix_cap_high ));
-
-				/* Here is where we must switch to posix pathname processing... */
-				if (client_unix_cap_low & CIFS_UNIX_POSIX_PATHNAMES_CAP) {
-					lp_set_posix_pathnames();
-					mangle_change_to_posix();
-				}
+			/* There should be 12 bytes of capabilities set. */
+			if (total_data < 8) {
+				reply_nterror(
+					req,
+					NT_STATUS_INVALID_PARAMETER);
+				return;
+			}
+			sconn->smb1.unix_info.client_major = SVAL(pdata,0);
+			sconn->smb1.unix_info.client_minor = SVAL(pdata,2);
+			sconn->smb1.unix_info.client_cap_low = IVAL(pdata,4);
+			sconn->smb1.unix_info.client_cap_high = IVAL(pdata,8);
+			/* Just print these values for now. */
+			DEBUG(10,("call_trans2setfsinfo: set unix_info info. major = %u, minor = %u \
+cap_low = 0x%x, cap_highn",
+				(unsigned int)sconn->smb1.unix_info.client_major,
+				(unsigned int)sconn->smb1.unix_info.client_minor,
+				(unsigned int)sconn->smb1.unix_info.client_cap_low,
+				(unsigned int)sconn->smb1.unix_info.client_cap_high));
+
+			/* Here is where we must switch to posix pathname processing... */
+			if (sconn->smb1.unix_info.client_cap_low & CIFS_UNIX_POSIX_PATHNAMES_CAP) {
+				lp_set_posix_pathnames();
+				mangle_change_to_posix();
+			}
 
-				if ((client_unix_cap_low & CIFS_UNIX_FCNTL_LOCKS_CAP) &&
-				    !(client_unix_cap_low & CIFS_UNIX_POSIX_PATH_OPERATIONS_CAP)) {
-					/* Client that knows how to do posix locks,
-					 * but not posix open/mkdir operations. Set a
-					 * default type for read/write checks. */
+			if ((sconn->smb1.unix_info.client_cap_low & CIFS_UNIX_FCNTL_LOCKS_CAP) &&
+			    !(sconn->smb1.unix_info.client_cap_low & CIFS_UNIX_POSIX_PATH_OPERATIONS_CAP)) {
+				/* Client that knows how to do posix locks,
+				 * but not posix open/mkdir operations. Set a
+				 * default type for read/write checks. */
 
-					lp_set_posix_default_cifsx_readwrite_locktype(POSIX_LOCK);
+				lp_set_posix_default_cifsx_readwrite_locktype(POSIX_LOCK);
 
-				}
-				break;
 			}
+			break;
 
 		case SMB_REQUEST_TRANSPORT_ENCRYPTION:
 			{
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 0f0c540..1de7e79 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -979,14 +979,6 @@ static bool run_readwritelarge_internal(void)
 	cli_sockopt(cli1, sockops);
 	memset(buf,'\0',sizeof(buf));
 
-	if (signing_state == Required) {
-		/* Horrible cheat to force
-		   multiple signed outstanding
-		   packets against a Samba server.
-		*/
-		cli1->is_samba = false;
-	}
-
 	printf("starting readwritelarge_internal\n");
 
 	cli_unlink(cli1, lockfname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c
index 246c3aa..97161a0 100644
--- a/source3/utils/smbcontrol.c
+++ b/source3/utils/smbcontrol.c
@@ -954,10 +954,10 @@ static bool do_winbind_online(struct messaging_context *msg_ctx,
 	/* Remove the entry in the winbindd_cache tdb to tell a later
 	   starting winbindd that we're online. */
 
-	tdb = tdb_open_log(cache_path("winbindd_cache.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600);
+	tdb = tdb_open_log(state_path("winbindd_cache.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600);
 	if (!tdb) {
 		fprintf(stderr, "Cannot open the tdb %s for writing.\n",
-			cache_path("winbindd_cache.tdb"));
+			state_path("winbindd_cache.tdb"));
 		return False;
 	}
 
@@ -984,14 +984,14 @@ static bool do_winbind_offline(struct messaging_context *msg_ctx,
 	   starting winbindd that we're offline. We may actually create
 	   it here... */
 
-	tdb = tdb_open_log(cache_path("winbindd_cache.tdb"),
+	tdb = tdb_open_log(state_path("winbindd_cache.tdb"),
 				WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE,
 				TDB_DEFAULT|TDB_INCOMPATIBLE_HASH /* TDB_CLEAR_IF_FIRST */,
 				O_RDWR|O_CREAT, 0600);
 
 	if (!tdb) {
 		fprintf(stderr, "Cannot open the tdb %s for writing.\n",
-			cache_path("winbindd_cache.tdb"));
+			state_path("winbindd_cache.tdb"));
 		return False;
 	}
 
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index b52fe77..2bb4df9 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -3150,9 +3150,9 @@ bool initialize_winbindd_cache(void)
 		tdb_close(wcache->tdb);
 		wcache->tdb = NULL;
 
-		if (unlink(cache_path("winbindd_cache.tdb")) == -1) {
+		if (unlink(state_path("winbindd_cache.tdb")) == -1) {
 			DEBUG(0,("initialize_winbindd_cache: unlink %s failed %s ",
-				cache_path("winbindd_cache.tdb"),
+				state_path("winbindd_cache.tdb"),
 				strerror(errno) ));
 			return false;
 		}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list