summaryrefslogtreecommitdiff
path: root/source4/lib/registry/tools/regshell.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-05-23 12:01:20 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:53:53 -0500
commitf371d2454298b0e64978c04056da5635d7e72921 (patch)
tree5bbe9b4bd4235992ced31c093aa358b89854f649 /source4/lib/registry/tools/regshell.c
parentf7a7192eff21fb48e4bd41ce65d0c0c175d4a1fb (diff)
downloadsamba-f371d2454298b0e64978c04056da5635d7e72921.tar.gz
samba-f371d2454298b0e64978c04056da5635d7e72921.tar.bz2
samba-f371d2454298b0e64978c04056da5635d7e72921.zip
r828: Some fixes in the core and regshell concerning hives and
unicode (This used to be commit 25c27b176c9905f3968e955f33a6db41b0102a38)
Diffstat (limited to 'source4/lib/registry/tools/regshell.c')
-rw-r--r--source4/lib/registry/tools/regshell.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c
index 26312ad4bc..dbddaa5dcf 100644
--- a/source4/lib/registry/tools/regshell.c
+++ b/source4/lib/registry/tools/regshell.c
@@ -32,6 +32,12 @@
* exit
*/
+static REG_KEY *cmd_pwd(REG_KEY *cur, int argc, char **argv)
+{
+ printf("%s\n", reg_key_get_path_abs(cur));
+ return cur;
+}
+
static REG_KEY *cmd_set(REG_KEY *cur, int argc, char **argv)
{
/* FIXME */
@@ -52,7 +58,7 @@ static REG_KEY *cmd_ck(REG_KEY *cur, int argc, char **argv)
}
}
- printf("Current path is: %s\n", reg_key_get_path(new));
+ printf("Current path is: %s\n", reg_key_get_path_abs(new));
return new;
}
@@ -68,7 +74,7 @@ static REG_KEY *cmd_ls(REG_KEY *cur, int argc, char **argv)
}
if(!W_ERROR_EQUAL(error, WERR_NO_MORE_ITEMS)) {
- DEBUG(0, ("Error occured while browsing thru keys\n"));
+ DEBUG(0, ("Error occured while browsing thru keys: %s\n", win_errstr(error)));
}
for(i = 0; W_ERROR_IS_OK(error = reg_key_get_value_by_index(cur, i, &value)); i++) {
@@ -90,7 +96,7 @@ static REG_KEY *cmd_mkkey(REG_KEY *cur, int argc, char **argv)
return NULL;
}
- fprintf(stderr, "Successfully added new subkey '%s' to '%s'\n", argv[1], reg_key_get_path(cur));
+ fprintf(stderr, "Successfully added new subkey '%s' to '%s'\n", argv[1], reg_key_get_path_abs(cur));
return NULL;
}
@@ -139,6 +145,11 @@ static REG_KEY *cmd_rmval(REG_KEY *cur, int argc, char **argv)
return NULL;
}
+static REG_KEY *cmd_hive(REG_KEY *cur, int argc, char **argv)
+{
+ /* FIXME */
+}
+
static REG_KEY *cmd_exit(REG_KEY *cur, int argc, char **argv)
{
exit(0);
@@ -154,10 +165,12 @@ struct {
REG_KEY *(*handle)(REG_KEY *, int argc, char **argv);
} regshell_cmds[] = {
{"ck", "cd", "Change current key", cmd_ck },
+ {"ch", "hive", "Change current hive", cmd_hive },
{"list", "ls", "List values/keys in current key", cmd_ls },
{"mkkey", "mkdir", "Make new key", cmd_mkkey },
{"rmval", "rm", "Remove value", cmd_rmval },
{"rmkey", "rmdir", "Remove key", cmd_rmkey },
+ {"pwd", "pwk", "Printing current key", cmd_pwd },
{"set", "update", "Update value", cmd_set },
{"help", "?", "Help", cmd_help },
{"exit", "quit", "Exit", cmd_exit },
@@ -235,7 +248,7 @@ static REG_KEY *process_cmd(REG_KEY *k, char *line)
while(True) {
char *line, *prompt;
- asprintf(&prompt, "%s> ", reg_key_get_path(curkey));
+ asprintf(&prompt, "%s> ", reg_key_get_path_abs(curkey));
line = smb_readline(prompt, NULL, NULL);