From 8f8c56bfbcbfe8f80afb09eb1d481a108b252bee Mon Sep 17 00:00:00 2001 From: Andrew Kroeger Date: Fri, 28 Mar 2008 01:08:49 -0500 Subject: Convert some more files to GPLv3. (This used to be commit ebe5e8399422eb7e2ff4deb546338823e2718907) --- source4/dsdb/samdb/ldb_modules/partition.c | 2 +- source4/dsdb/samdb/ldb_modules/samldb.c | 2 +- source4/dsdb/samdb/ldb_modules/schema.c | 2 -- source4/dsdb/samdb/ldb_modules/schema_syntax.c | 2 -- source4/dsdb/samdb/ldb_modules/schema_syntax.h | 2 -- 5 files changed, 2 insertions(+), 8 deletions(-) (limited to 'source4/dsdb') diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c index 78b5a09f78..56b05691bb 100644 --- a/source4/dsdb/samdb/ldb_modules/partition.c +++ b/source4/dsdb/samdb/ldb_modules/partition.c @@ -6,7 +6,7 @@ Copyright (C) Stefan Metzmacher 2007 * NOTICE: this module is NOT released under the GNU LGPL license as - * other ldb code. This module is release under the GNU GPL v2 or + * other ldb code. This module is release under the GNU GPL v3 or * later license. This program is free software; you can redistribute it and/or modify diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c index 5407db9956..3b67ca19d3 100644 --- a/source4/dsdb/samdb/ldb_modules/samldb.c +++ b/source4/dsdb/samdb/ldb_modules/samldb.c @@ -5,7 +5,7 @@ Copyright (C) Andrew Bartlett 2005 * NOTICE: this module is NOT released under the GNU LGPL license as - * other ldb code. This module is release under the GNU GPL v2 or + * other ldb code. This module is release under the GNU GPL v3 or * later license. This program is free software; you can redistribute it and/or modify diff --git a/source4/dsdb/samdb/ldb_modules/schema.c b/source4/dsdb/samdb/ldb_modules/schema.c index ff9530ca92..f2c4d38305 100644 --- a/source4/dsdb/samdb/ldb_modules/schema.c +++ b/source4/dsdb/samdb/ldb_modules/schema.c @@ -25,8 +25,6 @@ * Description: add schema check functionality * * Author: Simo Sorce - * - * License: GNU GPL v2 or Later */ #include "includes.h" diff --git a/source4/dsdb/samdb/ldb_modules/schema_syntax.c b/source4/dsdb/samdb/ldb_modules/schema_syntax.c index f737cc6fdc..d800e4b6d2 100644 --- a/source4/dsdb/samdb/ldb_modules/schema_syntax.c +++ b/source4/dsdb/samdb/ldb_modules/schema_syntax.c @@ -25,8 +25,6 @@ * Description: add schema syntax functionality * * Author: Simo Sorce - * - * License: GNU GPL v2 or Later */ #include "includes.h" diff --git a/source4/dsdb/samdb/ldb_modules/schema_syntax.h b/source4/dsdb/samdb/ldb_modules/schema_syntax.h index fa3fdbe5a2..37f7584d41 100644 --- a/source4/dsdb/samdb/ldb_modules/schema_syntax.h +++ b/source4/dsdb/samdb/ldb_modules/schema_syntax.h @@ -25,8 +25,6 @@ * Description: add schema syntax functionality * * Author: Simo Sorce - * - * License: GNU GPL v2 or Later */ -- cgit From e0c90d613121432700ea44011fda51e623de996c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 29 Mar 2008 11:18:00 +1100 Subject: Fix some valgrind issues. These small changes seem to fix some of the early issues in 'make valgrindtest' Previously, the subtree_delete code didn't pass on the timeout, leaving it uninitialised. The ldap_server/ldap_backend.c change tidies up the talloc hierarchy a bit. Andrew Bartlett (This used to be commit 95314f29a9cf83db71d37e68728bfb5009fce60d) --- source4/dsdb/samdb/ldb_modules/subtree_delete.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/dsdb') diff --git a/source4/dsdb/samdb/ldb_modules/subtree_delete.c b/source4/dsdb/samdb/ldb_modules/subtree_delete.c index 56ae7b239a..9c332d2969 100644 --- a/source4/dsdb/samdb/ldb_modules/subtree_delete.c +++ b/source4/dsdb/samdb/ldb_modules/subtree_delete.c @@ -160,6 +160,12 @@ static int subtree_delete(struct ldb_module *module, struct ldb_request *req) return ret; } + ret = ldb_set_timeout_from_prev_req(module->ldb, req, new_req); + + if (ret != LDB_SUCCESS) { + return ret; + } + ac->search_req = new_req; if (req == NULL) { ldb_oom(ac->module->ldb); -- cgit From 1c1c6fca660c304630672e87c20819daf8e008fc Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 29 Mar 2008 13:32:15 +1100 Subject: Fix more valgrind issues. This passes down the timeout more consistantly, and ensures that no matter how the modules screw up, we don't free() the memory we are going to write into the ASN1 packet until we actually write it out. Andrew Bartlett (This used to be commit eefd46289b90967ce6b4cd385fb1f7e1d6f9b343) --- source4/dsdb/samdb/ldb_modules/linked_attributes.c | 30 +++++++++++++++++++++- source4/dsdb/samdb/ldb_modules/subtree_rename.c | 16 +++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) (limited to 'source4/dsdb') diff --git a/source4/dsdb/samdb/ldb_modules/linked_attributes.c b/source4/dsdb/samdb/ldb_modules/linked_attributes.c index 8685c722aa..04b9987071 100644 --- a/source4/dsdb/samdb/ldb_modules/linked_attributes.c +++ b/source4/dsdb/samdb/ldb_modules/linked_attributes.c @@ -520,6 +520,12 @@ static int linked_attributes_modify(struct ldb_module *module, struct ldb_reques talloc_steal(new_req, attrs); + ret = ldb_set_timeout_from_prev_req(module->ldb, req, new_req); + + if (ret != LDB_SUCCESS) { + return ret; + } + /* Create a spot in the list for the requests */ ac->down_req = talloc_realloc(ac, ac->down_req, struct ldb_request *, ac->num_requests + 1); @@ -568,6 +574,12 @@ static int linked_attributes_modify(struct ldb_module *module, struct ldb_reques talloc_steal(new_req, attrs); + ret = ldb_set_timeout_from_prev_req(module->ldb, req, new_req); + + if (ret != LDB_SUCCESS) { + return ret; + } + /* Create a spot in the list for the requests */ ac->down_req = talloc_realloc(ac, ac->down_req, struct ldb_request *, ac->num_requests + 1); @@ -629,7 +641,11 @@ static int linked_attributes_modify(struct ldb_module *module, struct ldb_reques talloc_steal(new_req, new_msg); - ldb_set_timeout_from_prev_req(module->ldb, req, new_req); + ret = ldb_set_timeout_from_prev_req(module->ldb, req, new_req); + + if (ret != LDB_SUCCESS) { + return ret; + } /* Now add it to the list */ ac->down_req = talloc_realloc(ac, ac->down_req, @@ -752,6 +768,12 @@ static int linked_attributes_rename(struct ldb_module *module, struct ldb_reques talloc_steal(new_req, attrs); + ret = ldb_set_timeout_from_prev_req(module->ldb, req, new_req); + + if (ret != LDB_SUCCESS) { + return ret; + } + ac->search_req = new_req; ac->step = LA_SEARCH; return ldb_next_request(module, new_req); @@ -805,6 +827,12 @@ static int linked_attributes_delete(struct ldb_module *module, struct ldb_reques talloc_steal(new_req, attrs); + ret = ldb_set_timeout_from_prev_req(module->ldb, req, new_req); + + if (ret != LDB_SUCCESS) { + return ret; + } + ac->search_req = new_req; ac->step = LA_SEARCH; return ldb_next_request(module, new_req); diff --git a/source4/dsdb/samdb/ldb_modules/subtree_rename.c b/source4/dsdb/samdb/ldb_modules/subtree_rename.c index bf8124e253..fd1388d416 100644 --- a/source4/dsdb/samdb/ldb_modules/subtree_rename.c +++ b/source4/dsdb/samdb/ldb_modules/subtree_rename.c @@ -117,7 +117,15 @@ static int subtree_rename_search_callback(struct ldb_context *ldb, void *context NULL, NULL); - if (ret != LDB_SUCCESS) return ret; + if (ret != LDB_SUCCESS) { + return ret; + } + + ret = ldb_set_timeout_from_prev_req(ldb, ac->orig_req, req); + + if (ret != LDB_SUCCESS) { + return ret; + } talloc_steal(req, newdn); @@ -186,6 +194,12 @@ static int subtree_rename(struct ldb_module *module, struct ldb_request *req) return ret; } + ret = ldb_set_timeout_from_prev_req(module->ldb, req, new_req); + + if (ret != LDB_SUCCESS) { + return ret; + } + ac->down_req = talloc_realloc(ac, ac->down_req, struct ldb_request *, ac->num_requests + 1); if (!ac->down_req) { -- cgit From afe3e8172ddaa5e4aa811faceecda4f943d6e2ef Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 2 Apr 2008 04:53:27 +0200 Subject: Install public header files again and include required prototypes. (This used to be commit 47ffbbf67435904754469544390b67d34c958343) --- source4/dsdb/common/sidmap.c | 14 +++++++------- source4/dsdb/common/util.c | 5 +++-- source4/dsdb/samdb/ldb_modules/partition.c | 2 +- source4/dsdb/samdb/samdb_privilege.c | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) (limited to 'source4/dsdb') diff --git a/source4/dsdb/common/sidmap.c b/source4/dsdb/common/sidmap.c index 088dc6bd96..2144d61dfc 100644 --- a/source4/dsdb/common/sidmap.c +++ b/source4/dsdb/common/sidmap.c @@ -49,7 +49,7 @@ struct sidmap_context { /* open a sidmap context - use talloc_free to close */ -_PUBLIC_ struct sidmap_context *sidmap_open(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) +struct sidmap_context *sidmap_open(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { struct sidmap_context *sidmap; sidmap = talloc(mem_ctx, struct sidmap_context); @@ -123,7 +123,7 @@ static NTSTATUS sidmap_primary_domain_sid(struct sidmap_context *sidmap, /* map a sid to a unix uid */ -_PUBLIC_ NTSTATUS sidmap_sid_to_unixuid(struct sidmap_context *sidmap, +NTSTATUS sidmap_sid_to_unixuid(struct sidmap_context *sidmap, const struct dom_sid *sid, uid_t *uid) { const char *attrs[] = { "sAMAccountName", "uidNumber", @@ -221,7 +221,7 @@ allocated_sid: /* see if a sid is a group - very inefficient! */ -_PUBLIC_ bool sidmap_sid_is_group(struct sidmap_context *sidmap, struct dom_sid *sid) +bool sidmap_sid_is_group(struct sidmap_context *sidmap, struct dom_sid *sid) { const char *attrs[] = { "sAMAccountType", NULL }; int ret; @@ -262,7 +262,7 @@ _PUBLIC_ bool sidmap_sid_is_group(struct sidmap_context *sidmap, struct dom_sid /* map a sid to a unix gid */ -_PUBLIC_ NTSTATUS sidmap_sid_to_unixgid(struct sidmap_context *sidmap, +NTSTATUS sidmap_sid_to_unixgid(struct sidmap_context *sidmap, const struct dom_sid *sid, gid_t *gid) { const char *attrs[] = { "sAMAccountName", "gidNumber", @@ -355,7 +355,7 @@ allocated_sid: map a unix uid to a dom_sid the returned sid is allocated in the supplied mem_ctx */ -_PUBLIC_ NTSTATUS sidmap_uid_to_sid(struct sidmap_context *sidmap, +NTSTATUS sidmap_uid_to_sid(struct sidmap_context *sidmap, TALLOC_CTX *mem_ctx, const uid_t uid, struct dom_sid **sid) { @@ -453,7 +453,7 @@ allocate_sid: map a unix gid to a dom_sid the returned sid is allocated in the supplied mem_ctx */ -_PUBLIC_ NTSTATUS sidmap_gid_to_sid(struct sidmap_context *sidmap, +NTSTATUS sidmap_gid_to_sid(struct sidmap_context *sidmap, TALLOC_CTX *mem_ctx, const gid_t gid, struct dom_sid **sid) { @@ -550,7 +550,7 @@ allocate_sid: check if a sid is in the range of auto-allocated SIDs from our primary domain, and if it is, then return the name and atype */ -_PUBLIC_ NTSTATUS sidmap_allocated_sid_lookup(struct sidmap_context *sidmap, +NTSTATUS sidmap_allocated_sid_lookup(struct sidmap_context *sidmap, TALLOC_CTX *mem_ctx, const struct dom_sid *sid, const char **name, diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 1220a5c855..5164f7d181 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -28,6 +28,7 @@ #include "dsdb/samdb/samdb.h" #include "libcli/security/security.h" #include "librpc/gen_ndr/ndr_security.h" +#include "librpc/gen_ndr/ndr_misc.h" #include "dsdb/common/flags.h" #include "dsdb/common/proto.h" #include "libcli/ldap/ldap_ndr.h" @@ -1530,7 +1531,7 @@ static bool samdb_password_complexity_ok(const char *pass) The caller should probably have a transaction wrapping this */ -_PUBLIC_ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx, +NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx, struct ldb_dn *user_dn, struct ldb_dn *domain_dn, struct ldb_message *mod, @@ -1770,7 +1771,7 @@ _PUBLIC_ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ct and actually performs the password change */ -_PUBLIC_ NTSTATUS samdb_set_password_sid(struct ldb_context *ctx, TALLOC_CTX *mem_ctx, +NTSTATUS samdb_set_password_sid(struct ldb_context *ctx, TALLOC_CTX *mem_ctx, const struct dom_sid *user_sid, const char *new_pass, struct samr_Password *lmNewHash, diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c index 56b05691bb..7f136338be 100644 --- a/source4/dsdb/samdb/ldb_modules/partition.c +++ b/source4/dsdb/samdb/ldb_modules/partition.c @@ -87,7 +87,7 @@ static struct ldb_module *make_module_for_next_request(TALLOC_CTX *mem_ctx, struct ldb_module *module) { struct ldb_module *current; -_PUBLIC_ static const struct ldb_module_ops ops; /* zero */ + static const struct ldb_module_ops ops; /* zero */ current = talloc_zero(mem_ctx, struct ldb_module); if (current == NULL) { return module; diff --git a/source4/dsdb/samdb/samdb_privilege.c b/source4/dsdb/samdb/samdb_privilege.c index 3945dbb14b..5c2de81816 100644 --- a/source4/dsdb/samdb/samdb_privilege.c +++ b/source4/dsdb/samdb/samdb_privilege.c @@ -73,7 +73,7 @@ static NTSTATUS samdb_privilege_setup_sid(void *samctx, TALLOC_CTX *mem_ctx, setup the privilege mask for this security token based on our local SAM */ -_PUBLIC_ NTSTATUS samdb_privilege_setup(struct loadparm_context *lp_ctx, struct security_token *token) +NTSTATUS samdb_privilege_setup(struct loadparm_context *lp_ctx, struct security_token *token) { void *samctx; TALLOC_CTX *mem_ctx; -- cgit From 236fc02913adafd80921d4e30aa6ee1e414bef44 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 2 Apr 2008 13:41:10 +0200 Subject: Reduce the number of installed headers. (This used to be commit 2243e24024f09ff9c9c7d0eb735c3b39c9d84424) --- source4/dsdb/config.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/dsdb') diff --git a/source4/dsdb/config.mk b/source4/dsdb/config.mk index fb8cd4f503..1a20add91c 100644 --- a/source4/dsdb/config.mk +++ b/source4/dsdb/config.mk @@ -17,7 +17,7 @@ OBJ_FILES = \ repl/replicated_objects.o -PUBLIC_HEADERS += dsdb/samdb/samdb.h +# PUBLIC_HEADERS += dsdb/samdb/samdb.h [SUBSYSTEM::SAMDB_COMMON] PRIVATE_PROTO_HEADER = common/proto.h @@ -36,7 +36,7 @@ OBJ_FILES = \ schema/schema_constructed.o \ -PUBLIC_HEADERS += dsdb/schema/schema.h +# PUBLIC_HEADERS += dsdb/schema/schema.h ####################### # Start SUBSYSTEM DREPL_SRV -- cgit