diff options
author | Luke Leighton <lkcl@samba.org> | 1998-11-11 14:23:55 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1998-11-11 14:23:55 +0000 |
commit | 9f14f281ff7efa1af0242a1dd1f5220d5cfdbf49 (patch) | |
tree | 65504cd76855cbf4e4662fdb4b776d24469b33aa /source3/rpc_client/cli_reg.c | |
parent | 0e09fba835d0d65e2a927befaf3713dd481d8939 (diff) | |
download | samba-9f14f281ff7efa1af0242a1dd1f5220d5cfdbf49.tar.gz samba-9f14f281ff7efa1af0242a1dd1f5220d5cfdbf49.tar.bz2 samba-9f14f281ff7efa1af0242a1dd1f5220d5cfdbf49.zip |
changed syntax of registry commands so keys can start with HKLM or HKU.
sorted lookupsids command
(This used to be commit 13a0ee851fe0ce9acddfe57f9aba19fc78085c39)
Diffstat (limited to 'source3/rpc_client/cli_reg.c')
-rw-r--r-- | source3/rpc_client/cli_reg.c | 71 |
1 files changed, 33 insertions, 38 deletions
diff --git a/source3/rpc_client/cli_reg.c b/source3/rpc_client/cli_reg.c index 240a1fbb67..27c1c8e760 100644 --- a/source3/rpc_client/cli_reg.c +++ b/source3/rpc_client/cli_reg.c @@ -31,62 +31,57 @@ extern int DEBUGLEVEL; - /**************************************************************************** do a REG Open Policy ****************************************************************************/ -BOOL do_reg_connect(struct cli_state *cli, char *full_keyname, - POLICY_HND *reg_hnd, - POLICY_HND *key_hnd) +BOOL do_reg_connect(struct cli_state *cli, char *full_keyname, char *key_name, + POLICY_HND *reg_hnd) { - fstring key_name; - char *srch; - BOOL res1; - BOOL res = False; - BOOL hklm = False; - BOOL hku = False; + BOOL res = True; + uint32 reg_type = 0; if (full_keyname == NULL) { return False; } - srch = "HKLM"; - if (strnequal(full_keyname, srch, strlen(srch))) + ZERO_STRUCTP(reg_hnd); + + /* + * open registry receive a policy handle + */ + + if (!reg_split_key(full_keyname, ®_type, key_name)) + { + DEBUG(0,("do_reg_connect: unrecognised key name %s\n", full_keyname)); + return False; + } + + switch (reg_type) { - full_keyname += strlen(srch); - if (*full_keyname == '\\') + case HKEY_LOCAL_MACHINE: { - full_keyname++; - fstrcpy(key_name, full_keyname); + res = res ? do_reg_open_hklm(cli, + 0x84E0, 0x02000000, + reg_hnd) : False; + break; } - else if (*full_keyname != 0) + + case HKEY_USERS: { + res = res ? do_reg_open_hku(cli, + 0x84E0, 0x02000000, + reg_hnd) : False; + break; + } + default: + { + DEBUG(0,("do_reg_connect: unrecognised hive key\n")); return False; } } - /* open registry receive a policy handle */ - - if (hklm) - { - res = do_reg_open_hklm(cli, - 0x84E0, 0x02000000, - reg_hnd); - } - - if (hku) - { - res = do_reg_open_hku(cli, - 0x84E0, 0x02000000, - reg_hnd); - } - - /* open an entry */ - res1 = res ? do_reg_open_entry(cli, reg_hnd, - key_name, 0x02000000, key_hnd) : False; - - return res1 && res; + return res; } /**************************************************************************** |