diff options
author | Luke Leighton <lkcl@samba.org> | 1998-11-11 00:57:13 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1998-11-11 00:57:13 +0000 |
commit | c05254a15076711d382a58b85b5f08bf81cb1560 (patch) | |
tree | 35b2c86ec4bfb28a6194ad81cce3fdfd2badf93e /source/rpcclient/cmd_reg.c | |
parent | ddfdb6534671a0e9bbbefe555a92925d41abaddf (diff) | |
download | samba-c05254a15076711d382a58b85b5f08bf81cb1560.tar.gz samba-c05254a15076711d382a58b85b5f08bf81cb1560.tar.xz samba-c05254a15076711d382a58b85b5f08bf81cb1560.zip |
registry delete value command: "regdeleteval".
this is just so unbelievably simple to do...
Diffstat (limited to 'source/rpcclient/cmd_reg.c')
-rw-r--r-- | source/rpcclient/cmd_reg.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/source/rpcclient/cmd_reg.c b/source/rpcclient/cmd_reg.c index 28e511fa034..f36a42699d9 100644 --- a/source/rpcclient/cmd_reg.c +++ b/source/rpcclient/cmd_reg.c @@ -513,6 +513,71 @@ void cmd_reg_create_val(struct client_info *info) } /**************************************************************************** +nt registry delete value +****************************************************************************/ +void cmd_reg_delete_val(struct client_info *info) +{ + BOOL res = True; + BOOL res3 = True; + BOOL res4 = True; + + POLICY_HND parent_pol; + fstring parent_name; + fstring val_name; + + DEBUG(5, ("cmd_reg_delete_val: smb_cli->fd:%d\n", smb_cli->fd)); + + if (!next_token(NULL, parent_name, NULL, sizeof(parent_name))) + { + fprintf(out_hnd, "regcreate <parent key name> <val_name>\n"); + return; + } + + if (!next_token(NULL, val_name , NULL, sizeof(val_name ))) + { + fprintf(out_hnd, "regcreate <parent key name> <val_name>\n"); + return; + } + + /* open WINREG session. */ + res = res ? cli_nt_session_open(smb_cli, PIPE_WINREG) : False; + + /* open registry receive a policy handle */ + res = res ? do_reg_open_hklm(smb_cli, + 0x84E0, 0x02000000, + &info->dom.reg_pol_connect) : False; + + /* open an entry */ + res3 = res ? do_reg_open_entry(smb_cli, &info->dom.reg_pol_connect, + parent_name, 0x02000000, &parent_pol) : False; + + /* create an entry */ + res4 = res3 ? do_reg_delete_val(smb_cli, &parent_pol, val_name) : False; + + /* flush the modified key */ + res4 = res4 ? do_reg_flush_key(smb_cli, &parent_pol) : False; + + /* close the key handle */ + res3 = res3 ? do_reg_close(smb_cli, &parent_pol) : False; + + /* close the registry handles */ + res = res ? do_reg_close(smb_cli, &info->dom.reg_pol_connect) : False; + + /* close the session */ + cli_nt_session_close(smb_cli); + + if (res && res3 && res4) + { + DEBUG(5,("cmd_reg_delete_val: query succeeded\n")); + fprintf(out_hnd,"OK\n"); + } + else + { + DEBUG(5,("cmd_reg_delete_val: query failed\n")); + } +} + +/**************************************************************************** nt registry delete key ****************************************************************************/ void cmd_reg_delete_key(struct client_info *info) |