1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

r829: Implement 'hive' command

This commit is contained in:
Jelmer Vernooij 2004-05-23 12:12:50 +00:00 committed by Gerald (Jerry) Carter
parent 25c27b176c
commit 2a87981bd0
2 changed files with 20 additions and 1 deletions

View File

@ -93,6 +93,11 @@ uint32 reg_val_type( REG_VAL *val )
/**********************************************************************
*********************************************************************/
REG_HANDLE *reg_key_handle (REG_KEY *key)
{
return key->handle;
}
char *reg_key_name( REG_KEY *key )
{
return key->name;

View File

@ -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)