summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-11-21 14:01:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:59 -0500
commite56be1deade10ffb736e4b580aef8ddaff4e9e59 (patch)
tree7a450c256f0c97049bffcb8d593a1bdac0156d7f /source3/utils
parenteb96dddb281e5a6c69b12b05a8dda35b0e7f6de1 (diff)
downloadsamba-e56be1deade10ffb736e4b580aef8ddaff4e9e59.tar.gz
samba-e56be1deade10ffb736e4b580aef8ddaff4e9e59.tar.bz2
samba-e56be1deade10ffb736e4b580aef8ddaff4e9e59.zip
r19821: Make net_rpc_registry use net_run_function2.
Fix an erroneous NT_STATUS_NO_MEMORY found by Chetan S <cshring@gmail.com>. Thanks :-) Volker (This used to be commit 30f02e73fd85faa89186511edab4d5396d5efb6a)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc_registry.c38
1 files changed, 14 insertions, 24 deletions
diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c
index 65af269c02..4c740be44d 100644
--- a/source3/utils/net_rpc_registry.c
+++ b/source3/utils/net_rpc_registry.c
@@ -169,7 +169,7 @@ static NTSTATUS registry_enumkeys(TALLOC_CTX *ctx,
classes[i] = NULL;
- if ((pclass_buf) &&
+ if (pclass_buf && pclass_buf->name &&
(!(classes[i] = talloc_strdup(classes,
pclass_buf->name)))) {
status = NT_STATUS_NO_MEMORY;
@@ -912,31 +912,21 @@ out:
/********************************************************************
********************************************************************/
-static int net_help_registry( int argc, const char **argv )
-{
- d_printf("net rpc registry enumerate <path> [recurse] Enumerate the subkeya and values for a given registry path\n");
- d_printf("net rpc registry save <path> <file> Backup a registry tree to a file on the server\n");
- d_printf("net rpc registry dump <file> Dump the contents of a registry file to stdout\n");
-
- return -1;
-}
-
-/********************************************************************
-********************************************************************/
-
int net_rpc_registry(int argc, const char **argv)
{
- struct functable func[] = {
- {"enumerate", rpc_registry_enumerate},
- {"setvalue", rpc_registry_setvalue},
- {"save", rpc_registry_save},
- {"dump", rpc_registry_dump},
- {"copy", rpc_registry_copy},
- {NULL, NULL}
+ struct functable2 func[] = {
+ { "enumerate", rpc_registry_enumerate,
+ "Enumerate registry keys and values" },
+ { "setvalue", rpc_registry_setvalue,
+ "Set a new registry value" },
+ { "save", rpc_registry_save,
+ "Save a registry file" },
+ { "dump", rpc_registry_dump,
+ "Dump a registry file" },
+ { "copy", rpc_registry_copy,
+ "Copy a registry file" },
+ {NULL, NULL, NULL}
};
- if ( argc )
- return net_run_function( argc, argv, func, net_help_registry );
-
- return net_help_registry( argc, argv );
+ return net_run_function2(argc, argv, "net rpc registry", func);
}