diff options
author | Günther Deschner <gd@samba.org> | 2008-09-04 15:41:45 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-09-05 12:32:56 +0200 |
commit | d07f0e345e05fd895caaaf9af71593683dbfc685 (patch) | |
tree | 67fa7301bd0e5920a079a5c01a7701527258bcc0 /source3/utils | |
parent | 04e363c96153393186adb6b009eaadf6ee5af69e (diff) | |
download | samba-d07f0e345e05fd895caaaf9af71593683dbfc685.tar.gz samba-d07f0e345e05fd895caaaf9af71593683dbfc685.tar.bz2 samba-d07f0e345e05fd895caaaf9af71593683dbfc685.zip |
net: use netapi for rpc_sh_share_add as well.
Guenther
(This used to be commit 0c232742561a4001909ccce2c5160d57d09edb40)
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_rpc.c | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index b7d03d4e3f..18abc80ddd 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -4676,11 +4676,9 @@ static NTSTATUS rpc_sh_share_add(struct net_context *c, struct rpc_pipe_client *pipe_hnd, int argc, const char **argv) { - WERROR result; - NTSTATUS status; + NET_API_STATUS status; uint32_t parm_err = 0; - union srvsvc_NetShareInfo info; - struct srvsvc_NetShareInfo2 info2; + struct SHARE_INFO_2 i2; if ((argc < 2) || (argc > 3)) { d_fprintf(stderr, "usage: %s <share> <path> [comment]\n", @@ -4688,25 +4686,21 @@ static NTSTATUS rpc_sh_share_add(struct net_context *c, return NT_STATUS_INVALID_PARAMETER; } - info2.name = argv[0]; - info2.type = STYPE_DISKTREE; - info2.comment = (argc == 3) ? argv[2] : ""; - info2.permissions = 0; - info2.max_users = 0; - info2.current_users = 0; - info2.path = argv[1]; - info2.password = NULL; - - info.info2 = &info2; + i2.shi2_netname = argv[0]; + i2.shi2_type = STYPE_DISKTREE; + i2.shi2_remark = (argc == 3) ? argv[2] : ""; + i2.shi2_permissions = 0; + i2.shi2_max_uses = 0; + i2.shi2_current_uses = 0; + i2.shi2_path = argv[1]; + i2.shi2_passwd = NULL; - status = rpccli_srvsvc_NetShareAdd(pipe_hnd, mem_ctx, - pipe_hnd->desthost, - 2, - &info, - &parm_err, - &result); + status = NetShareAdd(pipe_hnd->desthost, + 2, + (uint8_t *)&i2, + &parm_err); - return status; + return werror_to_ntstatus(W_ERROR(status)); } static NTSTATUS rpc_sh_share_delete(struct net_context *c, |