diff options
author | Günther Deschner <gd@samba.org> | 2005-06-16 09:36:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:57:17 -0500 |
commit | 75545d578eb8f3450021c8eec4b1158dd95f44ef (patch) | |
tree | 0f022a460cffb5d2fd095d19691b2765f6998b26 /source3/rpc_client | |
parent | b162a396fecb08cc02addf17aed30fbc5e813f5b (diff) | |
download | samba-75545d578eb8f3450021c8eec4b1158dd95f44ef.tar.gz samba-75545d578eb8f3450021c8eec4b1158dd95f44ef.tar.bz2 samba-75545d578eb8f3450021c8eec4b1158dd95f44ef.zip |
r7632: Cleanup "net share migrate"-code.
* Allow to copy share security descriptors to already existing shares
separatly.
* Added abstraction function to enum all or a single share info
Guenther
(This used to be commit 97097497ae42d7a03286bbe16bcffb8224137688)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_srvsvc.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/source3/rpc_client/cli_srvsvc.c b/source3/rpc_client/cli_srvsvc.c index a8a6bc1ff6..b2449a7903 100644 --- a/source3/rpc_client/cli_srvsvc.c +++ b/source3/rpc_client/cli_srvsvc.c @@ -267,6 +267,63 @@ WERROR cli_srvsvc_net_share_get_info(struct cli_state *cli, info->switch_value = info_level; switch(info_level) { + case 1: + { + SRV_SHARE_INFO_1 *info1 = &info->share.info1; + SH_INFO_1_STR *info1_str = &info1->info_1_str; + + char *s; + + info->share.info1 = r.info.share.info1; + + /* Duplicate strings */ + + s = unistr2_tdup(mem_ctx, &info1_str->uni_netname); + if (s) + init_unistr2(&info1_str->uni_netname, + s, UNI_STR_TERMINATE); + + s = unistr2_tdup(mem_ctx, &info1_str->uni_remark); + if (s) + init_unistr2(&info1_str->uni_remark, + s, UNI_STR_TERMINATE); + + break; + } + case 2: + { + SRV_SHARE_INFO_2 *info2 = &info->share.info2; + SH_INFO_2_STR *info2_str = &info2->info_2_str; + + char *s; + + info->share.info2 = r.info.share.info2; + + /* Duplicate strings */ + + s = unistr2_tdup(mem_ctx, &info2_str->uni_netname); + if (s) + init_unistr2(&info2_str->uni_netname, + s, UNI_STR_TERMINATE); + + s = unistr2_tdup(mem_ctx, &info2_str->uni_remark); + if (s) + init_unistr2(&info2_str->uni_remark, + s, UNI_STR_TERMINATE); + + s = unistr2_tdup(mem_ctx, &info2_str->uni_path); + if (s) + init_unistr2(&info2_str->uni_path, + s, UNI_STR_TERMINATE); + + s = unistr2_tdup(mem_ctx, &info2_str->uni_passwd); + if (s) + init_unistr2(&info2_str->uni_passwd, + s, UNI_STR_TERMINATE); + + + break; + } case 502: { SRV_SHARE_INFO_502 *info502 = &info->share.info502; |