[SCM] Samba Shared Repository - branch v3-2-stable updated - release-3-2-0pre2-239-g328c228

Karolin Seeger kseeger at samba.org
Thu Mar 27 15:20:55 GMT 2008


The branch, v3-2-stable has been updated
       via  328c2282386079b94b65496b2f6b508044110b55 (commit)
       via  26f7edde6ca8d1c801a1000f6f1b290754c674c7 (commit)
       via  91c9b24286227db09a79bbb25c058d741d9aac45 (commit)
       via  ef6ed6433bd15a8ada7aeea23d6a74b1cb656114 (commit)
       via  24739fffa9aafc43c65f5e049ed2754ee4a55bd0 (commit)
       via  14ff3e4c97d064a639d2b90b490ad454dc78752e (commit)
       via  086372d10c20cb691262559a32c86d6e14ae4f50 (commit)
       via  c02067f4da009be7ef021b05686d7bc00091873e (commit)
       via  25a9faedb664377fe692f6a4064f570699b8e9a3 (commit)
       via  61cfc3b50dacb517a0512bb9dbfdc482dd6dc0ee (commit)
       via  2fc947f1a84d259aed2166d7f913de0eb9d1afb0 (commit)
       via  d56e5bb922302355fb1478a0317944c07675c873 (commit)
       via  5f2e1ac39f11d0df7c675c6a5bca317a8492d302 (commit)
       via  6fd0081bbcc40365831b7dcc0716e07e431f7b26 (commit)
       via  3f5ad39bcb870c6809c06e28a943b3b447739353 (commit)
       via  48624000d7ca3428cb53343c200062b09cc59107 (commit)
       via  5be0b778f023fbd9ffb43f1e7c88e2ed6e860486 (commit)
       via  294e246016f92e7f2690af500768f7c00db383a3 (commit)
       via  7427be3d8b9538e1e9434c845bba9fbc96d180d8 (commit)
       via  241a0fa648c534984827ae1505666ec046d2d78e (commit)
       via  1f475337c5cdf27862912264e4455b7a407897fe (commit)
       via  e25ff9623e58cf5d5960404791b7c66999925b83 (commit)
      from  cdeefea298c5dd53e1d01f0580bb8d33d8dbae22 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-stable


- Log -----------------------------------------------------------------
commit 328c2282386079b94b65496b2f6b508044110b55
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 27 13:00:23 2008 +0100

    Fix wbinfo -a trusted\\user%password on a Samba DC with trusts
    
    Winbind can't be allowed to connect to the local smbd.
    (cherry picked from commit 0d617f639a3c9c52e4327aed4bd02d9e8e7312a2)

commit 26f7edde6ca8d1c801a1000f6f1b290754c674c7
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Mar 25 22:35:20 2008 +0100

    Fix a valgrind error
    
    In winbind, we're using the info3 struct to send it to the winbind client after
    netsamlogon_cache_store. Without this info3->base.account_name.string was
    prematurely freed.
    (cherry picked from commit aa4377561b691e2c5108c18aeb34fff39d8775df)

commit 91c9b24286227db09a79bbb25c058d741d9aac45
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Mar 25 22:21:50 2008 +0100

    Fix a segfault
    
    When we get a NT_STATUS_WRONG_PASSWORD for example, my_info3 is not initialized
    at all. So first check that we have NT_STATUS_IS_OK(status) before we
    dereference my_info3.
    (cherry picked from commit 559cd9e5a7fac3ce3769d457132cdcb28569b93d)

commit ef6ed6433bd15a8ada7aeea23d6a74b1cb656114
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Mar 25 21:35:41 2008 +0100

    Fix typo
    (cherry picked from commit 38683a73013865695e1b04f5f6a974bd0c5c1cac)

commit 24739fffa9aafc43c65f5e049ed2754ee4a55bd0
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 23 19:43:36 2008 +0100

    Fix Coverity ID 514
    
    Not exactly an uninitialized variable, but having Coverity figure out that
    we're only UNMARSHALLING here is probably asking for a bit too much.
    (cherry picked from commit 07a9f7daa83c94afefe0d81db4812135121862c2)

commit 14ff3e4c97d064a639d2b90b490ad454dc78752e
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 23 19:38:50 2008 +0100

    Fix Coverity ID 504
    (cherry picked from commit 4e6f8a19a6861c332ee6e9b49551e12440eefdc2)

commit 086372d10c20cb691262559a32c86d6e14ae4f50
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 23 19:38:02 2008 +0100

    Fix Coverity ID 503
    (cherry picked from commit 5c43c38271bae7d96d0cfbdaba7bff838a684b40)

commit c02067f4da009be7ef021b05686d7bc00091873e
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 23 19:30:47 2008 +0100

    Fix Coverity ID 488
    
    "status" was used uninitialized on success -- metze, please check
    (cherry picked from commit a0859529c853ffb756b1deee946923b6fff6136e)

commit 25a9faedb664377fe692f6a4064f570699b8e9a3
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 23 19:26:35 2008 +0100

    Fix Coverity ID 487
    (cherry picked from commit 22cee9c1afbc33b4920b72bc81569d79642172af)

commit 61cfc3b50dacb517a0512bb9dbfdc482dd6dc0ee
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 23 18:10:28 2008 +0100

    Fix Coverity ID 471
    (cherry picked from commit d3b6df67fea0da5ffa962837400ebe07b34a5384)

commit 2fc947f1a84d259aed2166d7f913de0eb9d1afb0
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 23 18:08:13 2008 +0100

    Fix Coverity ID 472
    
    Simo, S4 also has this code. You might want to cherry-pick.
    
    Volker
    (cherry picked from commit 94c29f55937e50dcf49124d28ad4e82c7fb4133e)

commit d56e5bb922302355fb1478a0317944c07675c873
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 23 17:58:26 2008 +0100

    Fix Coverity ID 477
    (cherry picked from commit f17b1b0fc6340d21f1a2f43aa7eb2e87f851c51f)

commit 5f2e1ac39f11d0df7c675c6a5bca317a8492d302
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 23 17:57:01 2008 +0100

    Fix Coverity ID 478
    (cherry picked from commit 5f77938dc4a280b654b8d08656f19a7d04cea8c7)

commit 6fd0081bbcc40365831b7dcc0716e07e431f7b26
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 23 17:54:48 2008 +0100

    Fix Coverity ID 479
    (cherry picked from commit 70b33397ba6e18f40087fb642a1be62ee68d5f3a)

commit 3f5ad39bcb870c6809c06e28a943b3b447739353
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 23 17:53:05 2008 +0100

    Fix Coverity ID 480
    (cherry picked from commit 45677e8694f0e383baa65712faec6a565ec0ce5c)

commit 48624000d7ca3428cb53343c200062b09cc59107
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 23 17:50:55 2008 +0100

    Fix Coverity ID 450
    (cherry picked from commit 700cceb6940c95997cfef374cffd50729a35528a)

commit 5be0b778f023fbd9ffb43f1e7c88e2ed6e860486
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 23 17:49:04 2008 +0100

    Fix Coverity ID 453
    (cherry picked from commit 8f875674e7cf9ebd405561b1e3ab72b0284ce321)

commit 294e246016f92e7f2690af500768f7c00db383a3
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 23 17:32:46 2008 +0100

    Fix Coverity ID 462
    (cherry picked from commit 9cf1e16a9c3cade9cd905f719de07578b3a91b1e)

commit 7427be3d8b9538e1e9434c845bba9fbc96d180d8
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 23 15:58:09 2008 +0100

    Fix Coverity ID 432
    (cherry picked from commit 7070c77ee2a9c3c9ff1b3c7b93008b13b80ac02b)

commit 241a0fa648c534984827ae1505666ec046d2d78e
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 23 15:56:41 2008 +0100

    Fix Coverity ID 436
    (cherry picked from commit 9e0ee1ad4fe0f0e7dec0b6824ef234147d845b8d)

commit 1f475337c5cdf27862912264e4455b7a407897fe
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 23 15:51:52 2008 +0100

    Fix Coverity warnings
    
    ID 449, 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, 438, 437
    (cherry picked from commit 0d50b4ee9068d04d1d9eb7786e08775d7ba16bc8)

commit e25ff9623e58cf5d5960404791b7c66999925b83
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Mar 21 13:39:48 2008 +0100

    On Solaris, size_t seems to be only 32 bit.
    
    Fix bug 5341, thanks a lot to Karoly Vegh for testing it!
    
    Volker
    (cherry picked from commit 19eb8c9316b10b1277121e90d0d3ef50ee562118)

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

Summary of changes:
 source/lib/ldb/tools/ldbedit.c         |   10 ++++------
 source/lib/popt_common.c               |    5 +++++
 source/libads/ldap.c                   |    1 +
 source/libads/sasl.c                   |    2 ++
 source/libgpo/gpo_ini.c                |    4 ++--
 source/libsmb/clireadwrite.c           |   12 +++++++-----
 source/libsmb/samlogon_cache.c         |    2 +-
 source/modules/vfs_audit.c             |    6 +++++-
 source/modules/vfs_extd_audit.c        |    6 +++++-
 source/modules/vfs_full_audit.c        |    6 +++++-
 source/registry/reg_backend_printing.c |    6 ++----
 source/registry/regfio.c               |    2 +-
 source/rpc_parse/parse_buffer.c        |    6 ++++--
 source/rpc_parse/parse_spoolss.c       |    4 ++--
 source/rpc_server/srv_eventlog_lib.c   |    2 --
 source/rpc_server/srv_pipe.c           |    2 ++
 source/utils/net.c                     |    2 +-
 source/utils/net_ads.c                 |    2 +-
 source/winbindd/winbindd.c             |    2 +-
 source/winbindd/winbindd_cache.c       |    5 +++++
 source/winbindd/winbindd_dual.c        |    1 -
 source/winbindd/winbindd_pam.c         |    2 +-
 22 files changed, 57 insertions(+), 33 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/lib/ldb/tools/ldbedit.c b/source/lib/ldb/tools/ldbedit.c
index f8d1804..0e1fd38 100644
--- a/source/lib/ldb/tools/ldbedit.c
+++ b/source/lib/ldb/tools/ldbedit.c
@@ -319,12 +319,10 @@ int main(int argc, const char **argv)
 
 	do_edit(ldb, result->msgs, result->count, options->editor);
 
-	if (result) {
-		ret = talloc_free(result);
-		if (ret == -1) {
-			fprintf(stderr, "talloc_free failed\n");
-			exit(1);
-		}
+	ret = talloc_free(result);
+	if (ret == -1) {
+		fprintf(stderr, "talloc_free failed\n");
+		exit(1);
 	}
 
 	talloc_free(ldb);
diff --git a/source/lib/popt_common.c b/source/lib/popt_common.c
index 7f7d23f..8f0f7c6 100644
--- a/source/lib/popt_common.c
+++ b/source/lib/popt_common.c
@@ -327,6 +327,11 @@ static void get_password_file(void)
 		close_it = True;
 	}
 
+	if (fd < 0) {
+		fprintf(stderr, "fd = %d, < 0\n", fd);
+		exit(1);
+	}
+
 	for(p = pass, *p = '\0'; /* ensure that pass is null-terminated */
 		p && p - pass < sizeof(pass);) {
 		switch (read(fd, p, 1)) {
diff --git a/source/libads/ldap.c b/source/libads/ldap.c
index 9ec06e5..00d36b7 100644
--- a/source/libads/ldap.c
+++ b/source/libads/ldap.c
@@ -3413,6 +3413,7 @@ ADS_STATUS ads_find_samaccount(ADS_STRUCT *ads,
 	filter = talloc_asprintf(mem_ctx, "(&(objectclass=user)(sAMAccountName=%s))",
 		samaccountname);
 	if (filter == NULL) {
+		status = ADS_ERROR_NT(NT_STATUS_NO_MEMORY);
 		goto out;
 	}
 
diff --git a/source/libads/sasl.c b/source/libads/sasl.c
index 798d0b4..55bc16a 100644
--- a/source/libads/sasl.c
+++ b/source/libads/sasl.c
@@ -597,6 +597,8 @@ static ADS_STATUS ads_sasl_spnego_gsskrb5_bind(ADS_STRUCT *ads, const gss_name_t
 		context_handle = GSS_C_NO_CONTEXT;
 	}
 
+	status = ADS_SUCCESS;
+
 failed:
 	if (context_handle != GSS_C_NO_CONTEXT)
 		gss_delete_sec_context(&minor_status, &context_handle, GSS_C_NO_BUFFER);
diff --git a/source/libgpo/gpo_ini.c b/source/libgpo/gpo_ini.c
index 306d6f9..da7a6e6 100644
--- a/source/libgpo/gpo_ini.c
+++ b/source/libgpo/gpo_ini.c
@@ -51,7 +51,7 @@ static NTSTATUS convert_file_from_ucs2(TALLOC_CTX *mem_ctx,
 				       const char *filename_in,
 				       char **filename_out)
 {
-	int tmp_fd = 0;
+	int tmp_fd = -1;
 	uint8 *data_in = NULL;
 	uint8 *data_out = NULL;
 	char *tmp_name = NULL;
@@ -112,7 +112,7 @@ static NTSTATUS convert_file_from_ucs2(TALLOC_CTX *mem_ctx,
 	status = NT_STATUS_OK;
 
  out:
-	if (tmp_fd) {
+	if (tmp_fd != -1) {
 		close(tmp_fd);
 	}
 
diff --git a/source/libsmb/clireadwrite.c b/source/libsmb/clireadwrite.c
index 64a6b7b..f292fcb 100644
--- a/source/libsmb/clireadwrite.c
+++ b/source/libsmb/clireadwrite.c
@@ -175,7 +175,7 @@ struct cli_pull_state {
 	struct cli_state *cli;
 	uint16_t fnum;
 	off_t start_offset;
-	size_t size;
+	SMB_OFF_T size;
 
 	NTSTATUS (*sink)(char *buf, size_t n, void *priv);
 	void *priv;
@@ -232,7 +232,7 @@ static void cli_pull_read_done(struct async_req *read_req);
 
 struct async_req *cli_pull_send(TALLOC_CTX *mem_ctx, struct cli_state *cli,
 				uint16_t fnum, off_t start_offset,
-				size_t size, size_t window_size,
+				SMB_OFF_T size, size_t window_size,
 				NTSTATUS (*sink)(char *buf, size_t n,
 						 void *priv),
 				void *priv)
@@ -284,7 +284,8 @@ struct async_req *cli_pull_send(TALLOC_CTX *mem_ctx, struct cli_state *cli,
 	state->requested = 0;
 
 	for (i=0; i<state->num_reqs; i++) {
-		size_t size_left, request_thistime;
+		SMB_OFF_T size_left;
+		size_t request_thistime;
 
 		if (state->requested >= size) {
 			state->num_reqs = i;
@@ -376,7 +377,8 @@ static void cli_pull_read_done(struct async_req *read_req)
 
 		if (state->requested < state->size) {
 			struct async_req *new_req;
-			size_t size_left, request_thistime;
+			SMB_OFF_T size_left;
+			size_t request_thistime;
 
 			size_left = state->size - state->requested;
 			request_thistime = MIN(size_left, state->chunk_size);
@@ -424,7 +426,7 @@ NTSTATUS cli_pull_recv(struct async_req *req, ssize_t *received)
 }
 
 NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum,
-		  off_t start_offset, size_t size, size_t window_size,
+		  off_t start_offset, SMB_OFF_T size, size_t window_size,
 		  NTSTATUS (*sink)(char *buf, size_t n, void *priv),
 		  void *priv, ssize_t *received)
 {
diff --git a/source/libsmb/samlogon_cache.c b/source/libsmb/samlogon_cache.c
index 73b570c..2358809 100644
--- a/source/libsmb/samlogon_cache.c
+++ b/source/libsmb/samlogon_cache.c
@@ -149,7 +149,7 @@ bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3)
 	/* so we fill it in since winbindd_getpwnam() makes use of it */
 
 	if (!info3->base.account_name.string) {
-		info3->base.account_name.string = talloc_strdup(mem_ctx, username);
+		info3->base.account_name.string = talloc_strdup(info3, username);
 	}
 
 	r.timestamp = t;
diff --git a/source/modules/vfs_audit.c b/source/modules/vfs_audit.c
index a63bf4f..cfb4ddf 100644
--- a/source/modules/vfs_audit.c
+++ b/source/modules/vfs_audit.c
@@ -111,7 +111,11 @@ static int audit_syslog_priority(vfs_handle_struct *handle)
 
 	int priority;
 
-	priority = lp_parm_enum(SNUM(handle->conn), "audit", "priority", enum_log_priorities, LOG_NOTICE);
+	priority = lp_parm_enum(SNUM(handle->conn), "audit", "priority",
+				enum_log_priorities, LOG_NOTICE);
+	if (priority == -1) {
+		priority = LOG_WARNING;
+	}
 
 	return priority;
 }
diff --git a/source/modules/vfs_extd_audit.c b/source/modules/vfs_extd_audit.c
index a21e281..926ec36 100644
--- a/source/modules/vfs_extd_audit.c
+++ b/source/modules/vfs_extd_audit.c
@@ -114,7 +114,11 @@ static int audit_syslog_priority(vfs_handle_struct *handle)
 
 	int priority;
 
-	priority = lp_parm_enum(SNUM(handle->conn), "extd_audit", "priority", enum_log_priorities, LOG_NOTICE);
+	priority = lp_parm_enum(SNUM(handle->conn), "extd_audit", "priority",
+				enum_log_priorities, LOG_NOTICE);
+	if (priority == -1) {
+		priority = LOG_WARNING;
+	}
 
 	return priority;
 }
diff --git a/source/modules/vfs_full_audit.c b/source/modules/vfs_full_audit.c
index 6a88613..19218cc 100644
--- a/source/modules/vfs_full_audit.c
+++ b/source/modules/vfs_full_audit.c
@@ -679,7 +679,11 @@ static int audit_syslog_priority(vfs_handle_struct *handle)
 
 	int priority;
 
-	priority = lp_parm_enum(SNUM(handle->conn), "full_audit", "priority", enum_log_priorities, LOG_NOTICE);
+	priority = lp_parm_enum(SNUM(handle->conn), "full_audit", "priority",
+				enum_log_priorities, LOG_NOTICE);
+	if (priority == -1) {
+		priority = LOG_WARNING;
+	}
 
 	return priority;
 }
diff --git a/source/registry/reg_backend_printing.c b/source/registry/reg_backend_printing.c
index 582989d..5c1e6eb 100644
--- a/source/registry/reg_backend_printing.c
+++ b/source/registry/reg_backend_printing.c
@@ -373,8 +373,7 @@ static bool key_printers_store_keys( const char *key, REGSUBKEY_CTR *subkeys )
 	
 	/* cleanup */
 	
-	if ( printer )
-		free_a_printer( &printer, 2 );
+	free_a_printer( &printer, 2 );
 
 	SAFE_FREE( existing_subkeys );
 
@@ -516,8 +515,7 @@ static int key_printers_fetch_values( const char *key, REGVAL_CTR *values )
 	if ( (key_index = lookup_printerkey( p_data, printerdatakey )) == -1  ) {
 		/* failure....should never happen if the client has a valid open handle first */
 		DEBUG(10,("key_printers_fetch_values: Unknown keyname [%s]\n", printerdatakey));
-		if ( printer )
-			free_a_printer( &printer, 2 );
+		free_a_printer( &printer, 2 );
 		return -1;
 	}
 	
diff --git a/source/registry/regfio.c b/source/registry/regfio.c
index 9eb2c58..b6e8229 100644
--- a/source/registry/regfio.c
+++ b/source/registry/regfio.c
@@ -1277,7 +1277,7 @@ static void regfio_mem_free( REGF_FILE *file )
 
 	/* nothing tdo do if there is no open file */
 
-	if ( !file || (file->fd == -1) )
+	if (file->fd == -1)
 		return 0;
 		
 	fd = file->fd;
diff --git a/source/rpc_parse/parse_buffer.c b/source/rpc_parse/parse_buffer.c
index bb39a58..63a73c4 100644
--- a/source/rpc_parse/parse_buffer.c
+++ b/source/rpc_parse/parse_buffer.c
@@ -374,8 +374,10 @@ bool smb_io_relarraystr(const char *desc, RPC_BUFFER *buffer, int depth, uint16
 			return False;
 	
 		do {
-			if (!smb_io_unistr(desc, &chaine, ps, depth))
+			if (!smb_io_unistr(desc, &chaine, ps, depth)) {
+				SAFE_FREE(chaine2);
 				return False;
+			}
 			
 			l_chaine=str_len_uni(&chaine);
 			
@@ -402,10 +404,10 @@ bool smb_io_relarraystr(const char *desc, RPC_BUFFER *buffer, int depth, uint16
 		{
 			chaine2[l_chaine2] = '\0';
 			*string=(uint16 *)TALLOC_MEMDUP(prs_get_mem_context(ps),chaine2,realloc_size);
+			SAFE_FREE(chaine2);
 			if (!*string) {
 				return False;
 			}
-			SAFE_FREE(chaine2);
 		}
 
 		if(!prs_set_offset(ps, old_offset))
diff --git a/source/rpc_parse/parse_spoolss.c b/source/rpc_parse/parse_spoolss.c
index 3bf8ef2..bf7166b 100644
--- a/source/rpc_parse/parse_spoolss.c
+++ b/source/rpc_parse/parse_spoolss.c
@@ -4785,7 +4785,7 @@ bool spoolss_io_q_addprinterex(const char *desc, SPOOL_Q_ADDPRINTEREX *q_u, prs_
 		if (!sec_io_desc_buf(desc, &q_u->secdesc_ctr, ps, depth))
 			return False;
 	} else {
-		uint32 dummy;
+		uint32 dummy = 0;
 
 		/* Parse a NULL security descriptor.  This should really
 			happen inside the sec_io_desc_buf() function. */
@@ -7205,7 +7205,7 @@ bool make_spoolss_q_getprintprocessordirectory(SPOOL_Q_GETPRINTPROCESSORDIRECTOR
 
 bool spoolss_io_q_getprintprocessordirectory(const char *desc, SPOOL_Q_GETPRINTPROCESSORDIRECTORY *q_u, prs_struct *ps, int depth)
 {
-	uint32 ptr;
+	uint32 ptr = 0;
 
 	prs_debug(ps, depth, desc, "spoolss_io_q_getprintprocessordirectory");
 	depth++;
diff --git a/source/rpc_server/srv_eventlog_lib.c b/source/rpc_server/srv_eventlog_lib.c
index 269e2f3..e232a30 100644
--- a/source/rpc_server/srv_eventlog_lib.c
+++ b/source/rpc_server/srv_eventlog_lib.c
@@ -464,8 +464,6 @@ int write_eventlog_tdb( TDB_CONTEXT * the_tdb, Eventlog_entry * ee )
 	if ( mem_ctx == NULL )
 		return 0;
 
-	if ( !ee )
-		return 0;
 	/* discard any entries that have bogus time, which usually indicates a bogus entry as well. */
 	if ( ee->record.time_generated == 0 )
 		return 0;
diff --git a/source/rpc_server/srv_pipe.c b/source/rpc_server/srv_pipe.c
index 6c1b65b..2721192 100644
--- a/source/rpc_server/srv_pipe.c
+++ b/source/rpc_server/srv_pipe.c
@@ -1593,6 +1593,8 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
 		}
 	}
 
+	ZERO_STRUCT(hdr_rb);
+
 	/* decode the bind request */
 	if(!smb_io_rpc_hdr_rb("", &hdr_rb, rpc_in_p, 0))  {
 		DEBUG(0,("api_pipe_bind_req: unable to unmarshall RPC_HDR_RB struct.\n"));
diff --git a/source/utils/net.c b/source/utils/net.c
index 586ea2f..1b21c5e 100644
--- a/source/utils/net.c
+++ b/source/utils/net.c
@@ -503,7 +503,7 @@ bool net_find_server(const char *domain,
 		*server_name = SMB_STRDUP("127.0.0.1");
 	}
 
-	if (!server_name || !*server_name) {
+	if (!*server_name) {
 		DEBUG(1,("no server to connect to\n"));
 		return False;
 	}
diff --git a/source/utils/net_ads.c b/source/utils/net_ads.c
index 44a2257..380e27e 100644
--- a/source/utils/net_ads.c
+++ b/source/utils/net_ads.c
@@ -1679,7 +1679,7 @@ static int net_ads_password(int argc, const char **argv)
 		fill in the KDC's addresss */
 	ads_connect(ads);
 
-	if (!ads || !ads->config.realm) {
+	if (!ads->config.realm) {
 		d_fprintf(stderr, "Didn't find the kerberos server!\n");
 		return -1;
 	}
diff --git a/source/winbindd/winbindd.c b/source/winbindd/winbindd.c
index 615f4a9..25ceeeb 100644
--- a/source/winbindd/winbindd.c
+++ b/source/winbindd/winbindd.c
@@ -1238,7 +1238,7 @@ int main(int argc, char **argv, char **envp)
 	wcache_tdc_clear();	
 	
 	if (!init_domain_list()) {
-		DEBUG(0,("unable to initalize domain list\n"));
+		DEBUG(0,("unable to initialize domain list\n"));
 		exit(1);
 	}
 
diff --git a/source/winbindd/winbindd_cache.c b/source/winbindd/winbindd_cache.c
index 4d81ee3..a8a98e5 100644
--- a/source/winbindd/winbindd_cache.c
+++ b/source/winbindd/winbindd_cache.c
@@ -37,6 +37,7 @@ extern bool opt_nocache;
 #ifdef HAVE_ADS
 extern struct winbindd_methods ads_methods;
 #endif
+extern struct winbindd_methods passdb_methods;
 
 /*
  * JRA. KEEP THIS LIST UP TO DATE IF YOU ADD CACHE ENTRIES.
@@ -135,6 +136,10 @@ static struct winbind_cache *get_cache(struct winbindd_domain *domain)
 
 	/* We have to know what type of domain we are dealing with first. */
 
+	if (domain->internal) {
+		domain->backend = &passdb_methods;
+		domain->initialized = True;
+	}
 	if ( !domain->initialized ) {
 		init_dc_connection( domain );
 	}
diff --git a/source/winbindd/winbindd_dual.c b/source/winbindd/winbindd_dual.c
index 2b756b2..3c342e5 100644
--- a/source/winbindd/winbindd_dual.c
+++ b/source/winbindd/winbindd_dual.c
@@ -1089,7 +1089,6 @@ static bool fork_domain_child(struct winbindd_child *child)
 	 * but not the main daemon */
 
 	if (child->domain && child->domain->internal && IS_DC) {
-		child->domain->internal = False;
 		child->domain->methods = &cache_methods;
 		child->domain->online = False;
 	}
diff --git a/source/winbindd/winbindd_pam.c b/source/winbindd/winbindd_pam.c
index c56eb1b..5712f08 100644
--- a/source/winbindd/winbindd_pam.c
+++ b/source/winbindd/winbindd_pam.c
@@ -1362,7 +1362,7 @@ NTSTATUS winbindd_dual_pam_auth_samlogon(struct winbindd_domain *domain,
 	 * caller, we look up the account flags ourselve - gd */
 
 	if ((state->request.flags & WBFLAG_PAM_INFO3_TEXT) && 
-	    (my_info3->base.acct_flags == 0) && NT_STATUS_IS_OK(result)) {
+	    NT_STATUS_IS_OK(result) && (my_info3->base.acct_flags == 0)) {
 
 		struct rpc_pipe_client *samr_pipe;
 		POLICY_HND samr_domain_handle, user_pol;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list