summaryrefslogtreecommitdiff
path: root/source4/lib/registry/tools
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/registry/tools')
-rw-r--r--source4/lib/registry/tools/regshell.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c
index dbddaa5dcf..b843e91120 100644
--- a/source4/lib/registry/tools/regshell.c
+++ b/source4/lib/registry/tools/regshell.c
@@ -147,7 +147,21 @@ static REG_KEY *cmd_rmval(REG_KEY *cur, int argc, char **argv)
static REG_KEY *cmd_hive(REG_KEY *cur, int argc, char **argv)
{
- /* FIXME */
+ int i;
+ WERROR error = WERR_OK;
+ for(i = 0; W_ERROR_IS_OK(error); i++) {
+ REG_KEY *hive;
+ error = reg_get_hive(reg_key_handle(cur), i, &hive);
+ if(!W_ERROR_IS_OK(error)) break;
+
+ if(argc == 1) {
+ printf("%s\n", reg_key_name(hive));
+ } else if(!strcmp(reg_key_name(hive), argv[1])) {
+ return hive;
+ }
+ reg_key_free(hive);
+ }
+ return NULL;
}
static REG_KEY *cmd_exit(REG_KEY *cur, int argc, char **argv)