net rpc registry: add a getvalueraw subcommand.
authorMichael Adam <obnox@samba.org>
Thu, 15 May 2008 14:49:25 +0000 (16:49 +0200)
committerMichael Adam <obnox@samba.org>
Thu, 15 May 2008 15:17:56 +0000 (17:17 +0200)
Michael
(This used to be commit 5b5b29302b53c31256dfa2fdefead458cb14c560)

source3/utils/net_rpc_registry.c

index a453dc5d5c2cbf7e58795c3cdf7233c99d1f8b65..a23caf5773866630ddc7496841b7d2327012a433 100644 (file)
@@ -580,6 +580,33 @@ done:
        return status;
 }
 
+static NTSTATUS rpc_registry_getvalue_full(struct net_context *c,
+                                          const DOM_SID *domain_sid,
+                                          const char *domain_name,
+                                          struct cli_state *cli,
+                                          struct rpc_pipe_client *pipe_hnd,
+                                          TALLOC_CTX *mem_ctx,
+                                          int argc,
+                                          const char **argv)
+{
+       return rpc_registry_getvalue_internal(c, domain_sid, domain_name,
+                                             cli, pipe_hnd, mem_ctx, false,
+                                             argc, argv);
+}
+
+static int rpc_registry_getvalue(struct net_context *c, int argc,
+                                const char **argv)
+{
+       if (argc != 2) {
+               d_fprintf(stderr, "usage: net rpc registry getvalue <key> "
+                         "<valuename>\n");
+               return -1;
+       }
+
+       return run_rpc_command(c, NULL, PI_WINREG, 0,
+               rpc_registry_getvalue_full, argc, argv);
+}
+
 static NTSTATUS rpc_registry_getvalue_raw(struct net_context *c,
                                          const DOM_SID *domain_sid,
                                          const char *domain_name,
@@ -590,12 +617,12 @@ static NTSTATUS rpc_registry_getvalue_raw(struct net_context *c,
                                          const char **argv)
 {
        return rpc_registry_getvalue_internal(c, domain_sid, domain_name,
-                                             cli, pipe_hnd, mem_ctx, false,
+                                             cli, pipe_hnd, mem_ctx, true,
                                              argc, argv);
 }
 
-static int rpc_registry_getvalue(struct net_context *c, int argc,
-                                const char **argv)
+static int rpc_registry_getvalueraw(struct net_context *c, int argc,
+                                   const char **argv)
 {
        if (argc != 2) {
                d_fprintf(stderr, "usage: net rpc registry getvalue <key> "
@@ -1197,6 +1224,8 @@ int net_rpc_registry(struct net_context *c, int argc, const char **argv)
                  "Delete a registry key" },
                { "getvalue", rpc_registry_getvalue,
                  "Print a registry value" },
+               { "getvalueraw", rpc_registry_getvalueraw,
+                 "Print a registry value" },
                { "setvalue",  rpc_registry_setvalue,
                  "Set a new registry value" },
                { "deletevalue",  rpc_registry_deletevalue,