Registry client library: Fixes the creation of new keys
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Sat, 13 Sep 2008 13:02:56 +0000 (15:02 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 21 Sep 2008 21:17:59 +0000 (23:17 +0200)
Giving the right permissions

source4/lib/registry/rpc.c
source4/lib/registry/tools/regshell.c

index 7469bb60d89d1d534e628498836f70cf28cc998a..69da90128eab633d827f10a9d705be885707d1c3 100644 (file)
@@ -348,7 +348,7 @@ static WERROR rpc_add_key(TALLOC_CTX *mem_ctx,
        chars_to_winreg_String(mem_ctx, &r.in.name, name);
        chars_to_winreg_String(mem_ctx, &r.in.keyclass, NULL);
        r.in.options = 0;
-       r.in.access_mask = SEC_STD_ALL;
+       r.in.access_mask = 0x02000000;
        r.in.secdesc = NULL;
        r.in.action_taken = NULL;
        r.out.new_handle = &rpck->pol;
index 208b19fba88e1f7677fb1a3339b60485133d2df9..5c308bfbda8a199488d461a3231f60112323d2e9 100644 (file)
@@ -246,7 +246,8 @@ static WERROR cmd_mkkey(struct regshell_context *ctx, int argc, char **argv)
        error = reg_key_add_name(ctx, ctx->current, argv[1], 0, NULL, &tmp);
 
        if (!W_ERROR_IS_OK(error)) {
-               fprintf(stderr, "Error adding new subkey '%s'\n", argv[1]);
+               fprintf(stderr, "Error adding new subkey '%s': %s\n", argv[1],
+                       win_errstr(error));
                return error;
        }