summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilco Baan Hofman <wilco@baanhofman.nl>2010-05-24 20:05:42 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-06-20 17:19:12 +0200
commitc09922cfae1364f2ce8736ae59053805a337658b (patch)
tree07b5e6cd83043cf3e1e9cfe6fcac4eff80368ca9
parent5c2c8dfc5a90eddcaab2d78379d898a00e865ec2 (diff)
downloadsamba-c09922cfae1364f2ce8736ae59053805a337658b.tar.gz
samba-c09922cfae1364f2ce8736ae59053805a337658b.tar.bz2
samba-c09922cfae1364f2ce8736ae59053805a337658b.zip
Code cleanups: GUID generation, lp_dnsdomain instead of lp_realm, missing spaces.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
-rw-r--r--source4/lib/policy/gp_ldap.c4
-rw-r--r--source4/lib/policy/gp_manage.c11
2 files changed, 6 insertions, 9 deletions
diff --git a/source4/lib/policy/gp_ldap.c b/source4/lib/policy/gp_ldap.c
index 3e0d37dbcc..f2183b3439 100644
--- a/source4/lib/policy/gp_ldap.c
+++ b/source4/lib/policy/gp_ldap.c
@@ -215,7 +215,7 @@ NTSTATUS gp_list_all_gpos(struct gp_context *gp_ctx, struct gp_object ***ret)
rv = ldb_search(gp_ctx->ldb_ctx, mem_ctx, &result, dn, LDB_SCOPE_ONELEVEL, attrs, "(objectClass=groupPolicyContainer)");
if (rv != LDB_SUCCESS) {
- DEBUG(0, ("LDB search failed: %s\n%s\n", ldb_strerror(rv),ldb_errstring(gp_ctx->ldb_ctx)));
+ DEBUG(0, ("LDB search failed: %s\n%s\n", ldb_strerror(rv), ldb_errstring(gp_ctx->ldb_ctx)));
talloc_free(mem_ctx);
return NT_STATUS_UNSUCCESSFUL;
}
@@ -271,7 +271,7 @@ NTSTATUS gp_get_gpo_info(struct gp_context *gp_ctx, const char *dn_str, struct g
attrs,
"objectClass=groupPolicyContainer");
if (rv != LDB_SUCCESS) {
- DEBUG(0, ("LDB search failed: %s\n%s\n", ldb_strerror(rv),ldb_errstring(gp_ctx->ldb_ctx)));
+ DEBUG(0, ("LDB search failed: %s\n%s\n", ldb_strerror(rv), ldb_errstring(gp_ctx->ldb_ctx)));
talloc_free(mem_ctx);
return NT_STATUS_UNSUCCESSFUL;
}
diff --git a/source4/lib/policy/gp_manage.c b/source4/lib/policy/gp_manage.c
index 968eaf2025..31a3a1cb5f 100644
--- a/source4/lib/policy/gp_manage.c
+++ b/source4/lib/policy/gp_manage.c
@@ -20,6 +20,7 @@
#include "../libcli/security/dom_sid.h"
#include "../libcli/security/security_descriptor.h"
#include "../librpc/ndr/libndr.h"
+#include "../lib/util/charset/charset.h"
#include "param/param.h"
#include "lib/policy/policy.h"
@@ -117,7 +118,6 @@ NTSTATUS gp_create_gpo (struct gp_context *gp_ctx, const char *display_name, str
struct security_descriptor *sd;
TALLOC_CTX *mem_ctx;
struct gp_object *gpo;
- unsigned int i;
NTSTATUS status;
/* Create a forked memory context, as a base for everything here */
@@ -128,11 +128,8 @@ NTSTATUS gp_create_gpo (struct gp_context *gp_ctx, const char *display_name, str
/* Generate a GUID */
guid_struct = GUID_random();
- guid_str = GUID_string(mem_ctx, &guid_struct);
- name = talloc_asprintf(gpo, "{%s}", guid_str);
- for (i = 0; name[i] != '\0'; i++) {
- name[i] = toupper(name[i]);
- }
+ guid_str = GUID_string2(mem_ctx, &guid_struct);
+ name = strupper_talloc(mem_ctx, guid_str);
/* Prepare the GPO struct */
gpo->dn = NULL;
@@ -140,7 +137,7 @@ NTSTATUS gp_create_gpo (struct gp_context *gp_ctx, const char *display_name, str
gpo->flags = 0;
gpo->version = 0;
gpo->display_name = talloc_strdup(gpo, display_name);
- gpo->file_sys_path = talloc_asprintf(gpo, "\\\\%s\\sysvol\\%s\\Policies\\%s", lp_realm(gp_ctx->lp_ctx), lp_realm(gp_ctx->lp_ctx), name);
+ gpo->file_sys_path = talloc_asprintf(gpo, "\\\\%s\\sysvol\\%s\\Policies\\%s", lp_dnsdomain(gp_ctx->lp_ctx), lp_dnsdomain(gp_ctx->lp_ctx), name);
/* Create the GPT */
status = gp_create_gpt(gp_ctx, name, gpo->file_sys_path);