diff options
author | Luke Leighton <lkcl@samba.org> | 1999-02-23 22:39:54 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-02-23 22:39:54 +0000 |
commit | 1e71ecdcb21f24e70ee5edbbc05de0284fa588f4 (patch) | |
tree | 4c00ca048f4400e768c3611a35d77200a5ab1605 /source3/rpcclient | |
parent | 5c5f5445384bf1c55ad28ee7c24b2cce14744a80 (diff) | |
download | samba-1e71ecdcb21f24e70ee5edbbc05de0284fa588f4.tar.gz samba-1e71ecdcb21f24e70ee5edbbc05de0284fa588f4.tar.bz2 samba-1e71ecdcb21f24e70ee5edbbc05de0284fa588f4.zip |
added jeremy's new c++-like code for parsing of security descriptors.
(This used to be commit ec1b7000fd88c5a08e438c7033f60e49b9ec44a8)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r-- | source3/rpcclient/cmd_reg.c | 50 | ||||
-rw-r--r-- | source3/rpcclient/display.c | 6 |
2 files changed, 24 insertions, 32 deletions
diff --git a/source3/rpcclient/cmd_reg.c b/source3/rpcclient/cmd_reg.c index 54e726847a..95a439c462 100644 --- a/source3/rpcclient/cmd_reg.c +++ b/source3/rpcclient/cmd_reg.c @@ -739,7 +739,7 @@ void cmd_reg_test_key_sec(struct client_info *info) */ uint32 sec_buf_size; - SEC_DESC_BUF sec_buf; + SEC_DESC_BUF *psdb; DEBUG(5, ("cmd_reg_get_key_sec: smb_cli->fd:%d\n", smb_cli->fd)); @@ -771,32 +771,28 @@ void cmd_reg_test_key_sec(struct client_info *info) res3 = res ? do_reg_open_entry(smb_cli, fnum, &info->dom.reg_pol_connect, key_name, 0x02000000, &key_pol) : False; - /* query key sec info. first call sets sec_buf_size. */ + /* Get the size. */ sec_buf_size = 0; - ZERO_STRUCT(sec_buf); res4 = res3 ? do_reg_get_key_sec(smb_cli, fnum, &key_pol, - &sec_buf_size, &sec_buf) : False; + &sec_buf_size, &psdb) : False; - if (res4) - { - free_sec_desc_buf(&sec_buf); - } + free_sec_desc_buf(&psdb); res4 = res4 ? do_reg_get_key_sec(smb_cli, fnum, &key_pol, - &sec_buf_size, &sec_buf) : False; + &sec_buf_size, &psdb) : False; - if (res4 && sec_buf.len > 0 && sec_buf.sec != NULL) + if (res4 && psdb->len > 0 && psdb->sec != NULL) { - display_sec_desc(out_hnd, ACTION_HEADER , sec_buf.sec); - display_sec_desc(out_hnd, ACTION_ENUMERATE, sec_buf.sec); - display_sec_desc(out_hnd, ACTION_FOOTER , sec_buf.sec); + display_sec_desc(out_hnd, ACTION_HEADER , psdb->sec); + display_sec_desc(out_hnd, ACTION_ENUMERATE, psdb->sec); + display_sec_desc(out_hnd, ACTION_FOOTER , psdb->sec); res4 = res4 ? do_reg_set_key_sec(smb_cli, fnum, &key_pol, - sec_buf_size, sec_buf.sec) : False; + psdb) : False; - free_sec_desc_buf(&sec_buf); } + free_sec_desc_buf(&psdb); /* close the key handle */ if ((*key_name) != 0) @@ -840,7 +836,7 @@ void cmd_reg_get_key_sec(struct client_info *info) */ uint32 sec_buf_size; - SEC_DESC_BUF sec_buf; + SEC_DESC_BUF *psdb; DEBUG(5, ("cmd_reg_get_key_sec: smb_cli->fd:%d\n", smb_cli->fd)); @@ -872,29 +868,25 @@ void cmd_reg_get_key_sec(struct client_info *info) res3 = res ? do_reg_open_entry(smb_cli, fnum, &info->dom.reg_pol_connect, key_name, 0x02000000, &key_pol) : False; - /* query key sec info. first call sets sec_buf_size. */ + /* Get the size. */ sec_buf_size = 0; - ZERO_STRUCT(sec_buf); res4 = res3 ? do_reg_get_key_sec(smb_cli, fnum, &key_pol, - &sec_buf_size, &sec_buf) : False; + &sec_buf_size, &psdb) : False; - if (res4) - { - free_sec_desc_buf(&sec_buf); - } + free_sec_desc_buf(&psdb); res4 = res4 ? do_reg_get_key_sec(smb_cli, fnum, &key_pol, - &sec_buf_size, &sec_buf) : False; + &sec_buf_size, &psdb) : False; - if (res4 && sec_buf.len > 0 && sec_buf.sec != NULL) + if (res4 && psdb->len > 0 && psdb->sec != NULL) { - display_sec_desc(out_hnd, ACTION_HEADER , sec_buf.sec); - display_sec_desc(out_hnd, ACTION_ENUMERATE, sec_buf.sec); - display_sec_desc(out_hnd, ACTION_FOOTER , sec_buf.sec); + display_sec_desc(out_hnd, ACTION_HEADER , psdb->sec); + display_sec_desc(out_hnd, ACTION_ENUMERATE, psdb->sec); + display_sec_desc(out_hnd, ACTION_FOOTER , psdb->sec); - free(sec_buf.sec); } + free_sec_desc_buf(&psdb); /* close the key handle */ if ((*key_name) != 0) diff --git a/source3/rpcclient/display.c b/source3/rpcclient/display.c index ce464a72e6..060dac8d55 100644 --- a/source3/rpcclient/display.c +++ b/source3/rpcclient/display.c @@ -1355,9 +1355,9 @@ void display_sec_acl(FILE *out_hnd, enum action_type action, SEC_ACL *sec_acl) int i; for (i = 0; i < sec_acl->num_aces; i++) { - display_sec_ace(out_hnd, ACTION_HEADER , &sec_acl->ace[i]); - display_sec_ace(out_hnd, ACTION_ENUMERATE, &sec_acl->ace[i]); - display_sec_ace(out_hnd, ACTION_FOOTER , &sec_acl->ace[i]); + display_sec_ace(out_hnd, ACTION_HEADER , &sec_acl->ace_list[i]); + display_sec_ace(out_hnd, ACTION_ENUMERATE, &sec_acl->ace_list[i]); + display_sec_ace(out_hnd, ACTION_FOOTER , &sec_acl->ace_list[i]); } } |