From 74a9a391aa98dda542ef413d46d2080b450be127 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 23 Oct 2008 01:42:27 +0200 Subject: s3-samr-server: _samr_DeleteUser needs to wipe out the user_handle on success. Guenther --- source3/rpc_server/srv_samr_nt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index d08bb50bb9..36be832a75 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -4908,6 +4908,8 @@ NTSTATUS _samr_DeleteUser(pipes_struct *p, if (!close_policy_hnd(p, r->in.user_handle)) return NT_STATUS_OBJECT_NAME_INVALID; + ZERO_STRUCTP(r->out.user_handle); + force_flush_samr_cache(disp_info); return NT_STATUS_OK; -- cgit From c017909e2e2f971c68303b98b4a8a5b9019b0f6d Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 23 Oct 2008 01:43:06 +0200 Subject: netapi: NetGroupEnum_r needs to handle servers with no groups. Guenther --- source3/lib/netapi/group.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/lib/netapi/group.c b/source3/lib/netapi/group.c index 8dba4b8838..95c012a7f6 100644 --- a/source3/lib/netapi/group.c +++ b/source3/lib/netapi/group.c @@ -1243,7 +1243,7 @@ WERROR NetGroupEnum_r(struct libnetapi_ctx *ctx, goto done; } - if (r->out.resume_handle) { + if (r->out.resume_handle && info.info3.count > 0) { *r->out.resume_handle = info.info3.entries[info.info3.count-1].idx; } -- cgit From d115c4587f0d157fcb7f716524d92fbe1899f44c Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 23 Oct 2008 01:43:41 +0200 Subject: s3-build: fix some const build warnings. Guenther --- source3/libsmb/clispnego.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source3/libsmb/clispnego.c b/source3/libsmb/clispnego.c index fd312a4c0a..fb95d71925 100644 --- a/source3/libsmb/clispnego.c +++ b/source3/libsmb/clispnego.c @@ -152,7 +152,7 @@ bool spnego_parse_negTokenInit(DATA_BLOB blob, for (i=0; asn1_tag_remaining(data) > 0 && i < ASN1_MAX_OIDS-1; i++) { const char *oid_str = NULL; asn1_read_OID(data,NULL,&oid_str); - OIDs[i] = oid_str; + OIDs[i] = CONST_DISCARD(char *, oid_str); } OIDs[i] = NULL; asn1_end_tag(data); @@ -257,7 +257,7 @@ bool parse_negTokenTarg(DATA_BLOB blob, char *OIDs[ASN1_MAX_OIDS], DATA_BLOB *se for (i=0; asn1_tag_remaining(data) > 0 && i < ASN1_MAX_OIDS-1; i++) { const char *oid_str = NULL; asn1_read_OID(data,NULL,&oid_str); - OIDs[i] = oid_str; + OIDs[i] = CONST_DISCARD(char *, oid_str); } OIDs[i] = NULL; asn1_end_tag(data); -- cgit From 2f1dbddc3f5433b5b5c542cd3c8fa3050499d8e9 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 23 Oct 2008 02:18:09 +0200 Subject: s4-smbtorture: fix build warning. Guenther --- source4/torture/rpc/dssync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c index bee2658816..847b32827b 100644 --- a/source4/torture/rpc/dssync.c +++ b/source4/torture/rpc/dssync.c @@ -825,7 +825,7 @@ static bool test_FetchNT4Data(struct torture_context *tctx, struct drsuapi_DsGetNT4ChangeLog r; union drsuapi_DsGetNT4ChangeLogRequest req; union drsuapi_DsGetNT4ChangeLogInfo info; - int32_t level_out = 0; + uint32_t level_out = 0; struct GUID null_guid; struct dom_sid null_sid; DATA_BLOB cookie; -- cgit From e79835b096c716124ac5d6e78610e5a76172e649 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 23 Oct 2008 12:50:22 +1100 Subject: Clarify the linked attribute module behaviour with comments --- source4/dsdb/samdb/ldb_modules/linked_attributes.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source4/dsdb/samdb/ldb_modules/linked_attributes.c b/source4/dsdb/samdb/ldb_modules/linked_attributes.c index 14fd107d81..190a66cdb3 100644 --- a/source4/dsdb/samdb/ldb_modules/linked_attributes.c +++ b/source4/dsdb/samdb/ldb_modules/linked_attributes.c @@ -466,6 +466,9 @@ static int linked_attributes_modify(struct ldb_module *module, struct ldb_reques } } } else { + /* Flag that there was a DELETE + * without a value specified, so we + * need to look for the old value */ store_el = true; } @@ -475,6 +478,7 @@ static int linked_attributes_modify(struct ldb_module *module, struct ldb_reques if (store_el) { struct ldb_message_element *search_el; + /* Fill out ac->rc only if we have to find the old values */ if (!ac->rc) { ac->rc = talloc_zero(ac, struct replace_context); if (!ac->rc) { @@ -499,6 +503,9 @@ static int linked_attributes_modify(struct ldb_module *module, struct ldb_reques /* both replace and delete without values are handled in the callback * after the search on the entry to be modified is performed */ + + /* Only bother doing a search of this entry (to find old + * values) if replace or delete operations are attempted */ if (ac->rc) { const char **attrs; @@ -527,9 +534,10 @@ static int linked_attributes_modify(struct ldb_module *module, struct ldb_reques ret = ldb_next_request(module, search_req); } + } else { if (ac->ops) { - /* start the mod requests chain */ + /* Jump directly to handling the modifies */ ret = la_do_mod_request(ac); } else { /* nothing to do for this module, proceed */ -- cgit