[SCM] Samba Shared Repository - branch master updated

Matthias Dieter Wallnöfer mdw at samba.org
Tue Jun 29 14:55:17 MDT 2010


The branch, master has been updated
       via  f6f2120... s4:ntvfs/ipc/vfs_ipc.c - remove unused code
       via  146dad1... s4:ntvfs/ipc/vfs_ipc.c - add casts to suppress warnings on Solaris 10
       via  645c3d2... s4:ntp_signd/ntp_signd.c - add casts to suppress warnings on Solaris 10
       via  95127b3... s4:rpc_server/browser.c - remove unused code
       via  06bafb7... s4:smb_server/smb2/find.c - remove unused code
       via  00f189f... s4:smb_server/blob.c - remove unused code
       via  4f029f6... s4:dsdb/new_partition.c - remove the "ldb_next_request" call which we find also below the "if" block
       via  17a5c87... ldb:ldb_map_outbound.c - "ldb_parse_tree_collect_attrs" - remove unneeded return value
       via  8e9d7e8... ldb:ldb_modules.c - "ldb_dso_load_symbol" - remove unneeded caste before "dlsym"
       via  657045c... s4:ldb - "ldb_dn_update_components" - fix free of invalid DN parts
       via  f1e92c9... ldb:ldb_dn.c - "ldb_dn_set_extended_component" - free the linearized string when the components change
       via  0f0d9aa... s4:ldb_dn.c - make the code parts which free extended components consistent
       via  1e04f49... ldb:ldb_dn - "ldb_dn_explode" - move the "dn->comp_num" initalisation upwards and use "LDB_FREE" for freeing "dn->components"
      from  be7bff5... s4-smbtorture: remove some pointless mem_equal tests in LOCAL-NDR-WINREG testsuite.

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


- Log -----------------------------------------------------------------
commit f6f21202ebecc82832e10353bdf967cf7920a753
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Tue Jun 29 22:30:05 2010 +0200

    s4:ntvfs/ipc/vfs_ipc.c - remove unused code
    
    Spotted by the Solaris 10 compiler

commit 146dad103bac0488f8bacc45dfbb2ea099e852ee
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Tue Jun 29 22:33:32 2010 +0200

    s4:ntvfs/ipc/vfs_ipc.c - add casts to suppress warnings on Solaris 10

commit 645c3d200cd015597896d77fd4c22bc01a8b7da3
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Tue Jun 29 22:33:32 2010 +0200

    s4:ntp_signd/ntp_signd.c - add casts to suppress warnings on Solaris 10

commit 95127b3f5f253ce5df6ec27972c456d0859d23c4
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Tue Jun 29 22:30:05 2010 +0200

    s4:rpc_server/browser.c - remove unused code
    
    Spotted by the Solaris 10 compiler

commit 06bafb75965983601f9afd08b70c9f7463d4c5f3
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Tue Jun 29 22:30:05 2010 +0200

    s4:smb_server/smb2/find.c - remove unused code
    
    Spotted by the Solaris 10 compiler

commit 00f189f78ca5dcaf9917e231ddaef2b4398db0b5
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Tue Jun 29 22:30:05 2010 +0200

    s4:smb_server/blob.c - remove unused code
    
    Spotted by the Solaris 10 compiler

commit 4f029f6f1b443db0762c3bac275415b385c26435
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Tue Jun 29 22:23:15 2010 +0200

    s4:dsdb/new_partition.c - remove the "ldb_next_request" call which we find also below the "if" block

commit 17a5c876a69156843a8f4acca0e52e08845511fd
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Tue Jun 29 22:21:22 2010 +0200

    ldb:ldb_map_outbound.c - "ldb_parse_tree_collect_attrs" - remove unneeded return value

commit 8e9d7e84f6d4a0cdc4ed6d1a8a20c1fc88cefb76
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Tue Jun 29 22:16:15 2010 +0200

    ldb:ldb_modules.c - "ldb_dso_load_symbol" - remove unneeded caste before "dlsym"

commit 657045ca9aa4abe11088127a05d697e5ae99a5c9
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Tue Jun 29 22:10:14 2010 +0200

    s4:ldb - "ldb_dn_update_components" - fix free of invalid DN parts
    
    Use "LDB_FREE" for such free operations and in addition wipe also the casefolded
    DN out.

commit f1e92c91b21b354802b8e342e414d62368820b43
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Tue Jun 29 22:07:51 2010 +0200

    ldb:ldb_dn.c - "ldb_dn_set_extended_component" - free the linearized string when the components change

commit 0f0d9aa9b5959a12385c2b79d7dd35e9d081033c
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Tue Jun 29 22:04:24 2010 +0200

    s4:ldb_dn.c - make the code parts which free extended components consistent
    
    Cosmetic

commit 1e04f49ddbfaa002ba930f2b79883ed3688e1ea8
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Tue Jun 29 21:59:37 2010 +0200

    ldb:ldb_dn - "ldb_dn_explode" - move the "dn->comp_num" initalisation upwards and use "LDB_FREE" for freeing "dn->components"
    
    Mostly cosmetic - no behaviour change

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

Summary of changes:
 source4/dsdb/samdb/ldb_modules/new_partition.c |    4 +--
 source4/lib/ldb/common/ldb_dn.c                |   35 +++++++++++------------
 source4/lib/ldb/common/ldb_modules.c           |    3 +-
 source4/lib/ldb/ldb_map/ldb_map_outbound.c     |    2 -
 source4/ntp_signd/ntp_signd.c                  |    4 +-
 source4/ntvfs/ipc/vfs_ipc.c                    |   10 ++-----
 source4/rpc_server/browser/dcesrv_browser.c    |    2 -
 source4/smb_server/blob.c                      |    8 -----
 source4/smb_server/smb2/find.c                 |    3 --
 9 files changed, 24 insertions(+), 47 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/new_partition.c b/source4/dsdb/samdb/ldb_modules/new_partition.c
index a7de846..63c9200 100644
--- a/source4/dsdb/samdb/ldb_modules/new_partition.c
+++ b/source4/dsdb/samdb/ldb_modules/new_partition.c
@@ -148,9 +148,7 @@ static int new_partition_add(struct ldb_module *module, struct ldb_request *req)
 		return ldb_next_request(module, req);
 	}
 
-	if (!ldb_msg_find_element(req->op.add.message, "instanceType")) {
-		return ldb_next_request(module, req);		
-	} else {
+	if (ldb_msg_find_element(req->op.add.message, "instanceType")) {
 		/* This needs to be 'static' to ensure it does not move, and is not on the stack */
 		static const char *no_attrs[] = { NULL };
 		unsigned int instanceType = ldb_msg_find_attr_as_uint(req->op.add.message, "instanceType", 0);
diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c
index 5ce735f..f81f1a4 100644
--- a/source4/lib/ldb/common/ldb_dn.c
+++ b/source4/lib/ldb/common/ldb_dn.c
@@ -331,8 +331,9 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
 		return true;
 	}
 
-	/* make sure we free this if alloced previously before replacing */
-	talloc_free(dn->components);
+	/* make sure we free this if allocated previously before replacing */
+	LDB_FREE(dn->components);
+	dn->comp_num = 0;
 
 	LDB_FREE(dn->ext_components);
 	dn->ext_comp_num = 0;
@@ -343,7 +344,6 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
 	if ( ! dn->components) {
 		return false;
 	}
-	dn->comp_num = 0;
 
 	/* Components data space is allocated here once */
 	data = talloc_array(dn->components, char, strlen(parse_dn) + 1);
@@ -1431,9 +1431,9 @@ bool ldb_dn_add_base(struct ldb_dn *dn, struct ldb_dn *base)
 	/* Wipe the ext_linearized DN,
 	 * the GUID and SID are almost certainly no longer valid */
 	LDB_FREE(dn->ext_linearized);
-
 	LDB_FREE(dn->ext_components);
 	dn->ext_comp_num = 0;
+
 	return true;
 }
 
@@ -1559,7 +1559,6 @@ bool ldb_dn_add_child(struct ldb_dn *dn, struct ldb_dn *child)
 	/* Wipe the ext_linearized DN,
 	 * the GUID and SID are almost certainly no longer valid */
 	LDB_FREE(dn->ext_linearized);
-
 	LDB_FREE(dn->ext_components);
 	dn->ext_comp_num = 0;
 
@@ -1635,7 +1634,6 @@ bool ldb_dn_remove_base_components(struct ldb_dn *dn, unsigned int num)
 	/* Wipe the ext_linearized DN,
 	 * the GUID and SID are almost certainly no longer valid */
 	LDB_FREE(dn->ext_linearized);
-
 	LDB_FREE(dn->ext_components);
 	dn->ext_comp_num = 0;
 
@@ -1680,9 +1678,9 @@ bool ldb_dn_remove_child_components(struct ldb_dn *dn, unsigned int num)
 	/* Wipe the ext_linearized DN,
 	 * the GUID and SID are almost certainly no longer valid */
 	LDB_FREE(dn->ext_linearized);
-
 	LDB_FREE(dn->ext_components);
 	dn->ext_comp_num = 0;
+
 	return true;
 }
 
@@ -1703,9 +1701,9 @@ struct ldb_dn *ldb_dn_get_parent(void *mem_ctx, struct ldb_dn *dn)
 	/* Wipe the ext_linearized DN,
 	 * the GUID and SID are almost certainly no longer valid */
 	LDB_FREE(dn->ext_linearized);
-
 	LDB_FREE(dn->ext_components);
 	dn->ext_comp_num = 0;
+
 	return new_dn;
 }
 
@@ -1877,9 +1875,9 @@ int ldb_dn_set_component(struct ldb_dn *dn, int num,
 	/* Wipe the ext_linearized DN,
 	 * the GUID and SID are almost certainly no longer valid */
 	LDB_FREE(dn->ext_linearized);
-
-	dn->ext_comp_num = 0;
 	LDB_FREE(dn->ext_components);
+	dn->ext_comp_num = 0;
+
 	return LDB_SUCCESS;
 }
 
@@ -1927,7 +1925,6 @@ int ldb_dn_set_extended_component(struct ldb_dn *dn,
 					ldb_dn_mark_invalid(dn);
 					return LDB_ERR_OPERATIONS_ERROR;
 				}
-				return LDB_SUCCESS;
 			} else {
 				if (i != (dn->ext_comp_num - 1)) {
 					memmove(&dn->ext_components[i],
@@ -1945,9 +1942,10 @@ int ldb_dn_set_extended_component(struct ldb_dn *dn,
 					ldb_dn_mark_invalid(dn);
 					return LDB_ERR_OPERATIONS_ERROR;
 				}
-				return LDB_SUCCESS;
 			}
 			LDB_FREE(dn->ext_linearized);
+
+			return LDB_SUCCESS;
 		}
 	}
 
@@ -1978,14 +1976,16 @@ int ldb_dn_set_extended_component(struct ldb_dn *dn,
 	dn->ext_components = p;
 	dn->ext_comp_num++;
 
+	LDB_FREE(dn->ext_linearized);
+
 	return LDB_SUCCESS;
 }
 
 void ldb_dn_remove_extended_components(struct ldb_dn *dn)
 {
-	dn->ext_comp_num = 0;
-	LDB_FREE(dn->ext_components);
 	LDB_FREE(dn->ext_linearized);
+	LDB_FREE(dn->ext_components);
+	dn->ext_comp_num = 0;
 }
 
 bool ldb_dn_is_valid(struct ldb_dn *dn)
@@ -2037,10 +2037,9 @@ int ldb_dn_update_components(struct ldb_dn *dn, const struct ldb_dn *ref_dn)
 	       sizeof(struct ldb_dn_component)*ref_dn->comp_num);
 	dn->comp_num = ref_dn->comp_num;
 
-	talloc_free(dn->linearized);
-	talloc_free(dn->ext_linearized);
-	dn->ext_linearized = NULL;
-	dn->linearized = NULL;
+	LDB_FREE(dn->casefold);
+	LDB_FREE(dn->linearized);
+	LDB_FREE(dn->ext_linearized);
 
 	return LDB_SUCCESS;
 }
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c
index 21225ac..6e92fc5 100644
--- a/source4/lib/ldb/common/ldb_modules.c
+++ b/source4/lib/ldb/common/ldb_modules.c
@@ -318,8 +318,7 @@ static void *ldb_dso_load_symbol(struct ldb_context *ldb, const char *name,
 		return NULL;
 	}
 
-	sym = (int (*)(void))dlsym(handle, symbol);
-
+	sym = dlsym(handle, symbol);
 	if (sym == NULL) {
 		ldb_debug(ldb, LDB_DEBUG_ERROR, "no symbol `%s' found in %s: %s", symbol, path, dlerror());
 		return NULL;
diff --git a/source4/lib/ldb/ldb_map/ldb_map_outbound.c b/source4/lib/ldb/ldb_map/ldb_map_outbound.c
index 17d77d7..98cd525 100644
--- a/source4/lib/ldb/ldb_map/ldb_map_outbound.c
+++ b/source4/lib/ldb/ldb_map/ldb_map_outbound.c
@@ -565,8 +565,6 @@ static int ldb_parse_tree_collect_attrs(struct ldb_module *module, void *mem_ctx
 		*attrs = new_attrs;
 		return 0;
 	}
-
-	return -1;
 }
 
 static int map_subtree_select_local(struct ldb_module *module, void *mem_ctx, struct ldb_parse_tree **new, const struct ldb_parse_tree *tree);
diff --git a/source4/ntp_signd/ntp_signd.c b/source4/ntp_signd/ntp_signd.c
index 6a628e4..3110b20 100644
--- a/source4/ntp_signd/ntp_signd.c
+++ b/source4/ntp_signd/ntp_signd.c
@@ -346,10 +346,10 @@ static void ntp_signd_call_loop(struct tevent_req *subreq)
 
 	/* First add the length of the out buffer */
 	RSIVAL(call->out_hdr, 0, call->out.length);
-	call->out_iov[0].iov_base = call->out_hdr;
+	call->out_iov[0].iov_base = (char *) call->out_hdr;
 	call->out_iov[0].iov_len = 4;
 
-	call->out_iov[1].iov_base = call->out.data;
+	call->out_iov[1].iov_base = (char *) call->out.data;
 	call->out_iov[1].iov_len = call->out.length;
 
 	subreq = tstream_writev_queue_send(call,
diff --git a/source4/ntvfs/ipc/vfs_ipc.c b/source4/ntvfs/ipc/vfs_ipc.c
index 676f545..bfc792e 100644
--- a/source4/ntvfs/ipc/vfs_ipc.c
+++ b/source4/ntvfs/ipc/vfs_ipc.c
@@ -553,7 +553,7 @@ static int ipc_readv_next_vector(struct tstream_context *stream,
 		return -1;
 	}
 
-	vector[0].iov_base = state->buf + state->ofs;
+	vector[0].iov_base = (char *) (state->buf + state->ofs);
 	vector[0].iov_len = wanted;
 
 	state->ofs += wanted;
@@ -893,8 +893,6 @@ static NTSTATUS ipc_qfileinfo(struct ntvfs_module_context *ntvfs,
 	default:
 		return ntvfs_map_qfileinfo(ntvfs, req, info);
 	}
-	
-	return NT_STATUS_ACCESS_DENIED;
 }
 
 
@@ -1006,7 +1004,7 @@ static NTSTATUS ipc_dcerpc_cmd(struct ntvfs_module_context *ntvfs,
 	state->p = p;
 	state->req = req;
 	state->trans = trans;
-	state->writev_iov.iov_base = trans->in.data.data;
+	state->writev_iov.iov_base = (char *) trans->in.data.data;
 	state->writev_iov.iov_len = trans->in.data.length;
 
 	ipc_readv_next_vector_init(&state->next_vector,
@@ -1215,7 +1213,7 @@ static NTSTATUS ipc_ioctl_smb2(struct ntvfs_module_context *ntvfs,
 	state->p = p;
 	state->req = req;
 	state->io = io;
-	state->writev_iov.iov_base = io->smb2.in.out.data;
+	state->writev_iov.iov_base = (char *) io->smb2.in.out.data;
 	state->writev_iov.iov_len = io->smb2.in.out.length;
 
 	ipc_readv_next_vector_init(&state->next_vector,
@@ -1317,8 +1315,6 @@ static NTSTATUS ipc_ioctl(struct ntvfs_module_context *ntvfs,
 	default:
 		return NT_STATUS_ACCESS_DENIED;
 	}
-
-	return NT_STATUS_ACCESS_DENIED;
 }
 
 
diff --git a/source4/rpc_server/browser/dcesrv_browser.c b/source4/rpc_server/browser/dcesrv_browser.c
index 19b5609..1ce4652 100644
--- a/source4/rpc_server/browser/dcesrv_browser.c
+++ b/source4/rpc_server/browser/dcesrv_browser.c
@@ -72,8 +72,6 @@ static WERROR dcesrv_BrowserrQueryOtherDomains(struct dcesrv_call_state *dce_cal
 	default:
 		return WERR_UNKNOWN_LEVEL;
 	}
-
-	return WERR_INVALID_PARAM;
 }
 
 
diff --git a/source4/smb_server/blob.c b/source4/smb_server/blob.c
index c17cde0..adc223e 100644
--- a/source4/smb_server/blob.c
+++ b/source4/smb_server/blob.c
@@ -292,8 +292,6 @@ NTSTATUS smbsrv_push_passthru_fsinfo(TALLOC_CTX *mem_ctx,
 	default:
 		return NT_STATUS_INVALID_LEVEL;
 	}
-
-	return NT_STATUS_INVALID_LEVEL;
 }
 
 NTSTATUS smbsrv_push_passthru_fileinfo(TALLOC_CTX *mem_ctx,
@@ -509,8 +507,6 @@ NTSTATUS smbsrv_push_passthru_fileinfo(TALLOC_CTX *mem_ctx,
 	default:
 		return NT_STATUS_INVALID_LEVEL;
 	}
-
-	return NT_STATUS_INVALID_LEVEL;
 }
 
 NTSTATUS smbsrv_pull_passthru_sfileinfo(TALLOC_CTX *mem_ctx,
@@ -636,8 +632,6 @@ NTSTATUS smbsrv_pull_passthru_sfileinfo(TALLOC_CTX *mem_ctx,
 	default:
 		return NT_STATUS_INVALID_LEVEL;
 	}
-
-	return NT_STATUS_INVALID_LEVEL;
 }
 
 /*
@@ -784,6 +778,4 @@ NTSTATUS smbsrv_push_passthru_search(TALLOC_CTX *mem_ctx,
 	default:
 		return NT_STATUS_INVALID_LEVEL;
 	}
-
-	return NT_STATUS_INVALID_LEVEL;
 }
diff --git a/source4/smb_server/smb2/find.c b/source4/smb_server/smb2/find.c
index cd52872..17f09e1 100644
--- a/source4/smb_server/smb2/find.c
+++ b/source4/smb_server/smb2/find.c
@@ -130,9 +130,6 @@ static NTSTATUS smb2srv_find_backend(struct smb2srv_find_state *state)
 
 		return ntvfs_search_next(state->req->ntvfs, state->fn, state, smb2srv_find_callback);
 	}
-
-	/* should not be reached */
-	return NT_STATUS_INTERNAL_ERROR;
 }
 
 void smb2srv_find_recv(struct smb2srv_request *req)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list