summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-03-07 23:26:00 +0100
committerGünther Deschner <gd@samba.org>2008-03-07 23:26:00 +0100
commitad3a1b8475bc850578f0ee6a71747b204066340e (patch)
treeb00948d0d32915f0165d21a5c9ca1a2c2d783d51 /source3
parent024cf110b002bc71b0d45ff25ede9aa7e969a49b (diff)
downloadsamba-ad3a1b8475bc850578f0ee6a71747b204066340e.tar.gz
samba-ad3a1b8475bc850578f0ee6a71747b204066340e.tar.bz2
samba-ad3a1b8475bc850578f0ee6a71747b204066340e.zip
Use pidl for _srvsvc_NetShareDel and _srvsvc_NetShareDelSticky.
Guenther (This used to be commit 73b6587493d9a987a691ece495db9f42ce562efe)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_srvsvc.c46
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c46
2 files changed, 25 insertions, 67 deletions
diff --git a/source3/rpc_server/srv_srvsvc.c b/source3/rpc_server/srv_srvsvc.c
index 39548c5af3..875cda50f9 100644
--- a/source3/rpc_server/srv_srvsvc.c
+++ b/source3/rpc_server/srv_srvsvc.c
@@ -246,28 +246,7 @@ static bool api_srv_net_share_add(pipes_struct *p)
static bool api_srv_net_share_del(pipes_struct *p)
{
- SRV_Q_NET_SHARE_DEL q_u;
- SRV_R_NET_SHARE_DEL r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- /* Unmarshall the net server del info. */
- if(!srv_io_q_net_share_del("", &q_u, data, 0)) {
- DEBUG(0,("api_srv_net_share_del: Failed to unmarshall SRV_Q_NET_SHARE_DEL.\n"));
- return False;
- }
-
- r_u.status = _srv_net_share_del(p, &q_u, &r_u);
-
- if(!srv_io_r_net_share_del("", &r_u, rdata, 0)) {
- DEBUG(0,("api_srv_net_share_del: Failed to marshall SRV_R_NET_SHARE_DEL.\n"));
- return False;
- }
-
- return True;
+ return proxy_srvsvc_call(p, NDR_SRVSVC_NETSHAREDEL);
}
/*******************************************************************
@@ -276,28 +255,7 @@ static bool api_srv_net_share_del(pipes_struct *p)
static bool api_srv_net_share_del_sticky(pipes_struct *p)
{
- SRV_Q_NET_SHARE_DEL q_u;
- SRV_R_NET_SHARE_DEL r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- /* Unmarshall the net server del info. */
- if(!srv_io_q_net_share_del("", &q_u, data, 0)) {
- DEBUG(0,("api_srv_net_share_del_sticky: Failed to unmarshall SRV_Q_NET_SHARE_DEL.\n"));
- return False;
- }
-
- r_u.status = _srv_net_share_del_sticky(p, &q_u, &r_u);
-
- if(!srv_io_r_net_share_del("", &r_u, rdata, 0)) {
- DEBUG(0,("api_srv_net_share_del_sticky: Failed to marshall SRV_R_NET_SHARE_DEL.\n"));
- return False;
- }
-
- return True;
+ return proxy_srvsvc_call(p, NDR_SRVSVC_NETSHAREDELSTICKY);
}
/*******************************************************************
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index 3c5d1e4154..a6cf06caa7 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -1905,11 +1905,13 @@ WERROR _srv_net_share_add(pipes_struct *p, SRV_Q_NET_SHARE_ADD *q_u, SRV_R_NET_S
}
/*******************************************************************
- Net share delete. Call "delete share command" with the share name as
+ _srvsvc_NetShareDel
+ Call "delete share command" with the share name as
a parameter.
********************************************************************/
-WERROR _srv_net_share_del(pipes_struct *p, SRV_Q_NET_SHARE_DEL *q_u, SRV_R_NET_SHARE_DEL *r_u)
+WERROR _srvsvc_NetShareDel(pipes_struct *p,
+ struct srvsvc_NetShareDel *r)
{
struct current_user user;
char *command = NULL;
@@ -1921,10 +1923,9 @@ WERROR _srv_net_share_del(pipes_struct *p, SRV_Q_NET_SHARE_DEL *q_u, SRV_R_NET_S
struct share_params *params;
TALLOC_CTX *ctx = p->mem_ctx;
- DEBUG(5,("_srv_net_share_del: %d\n", __LINE__));
-
- share_name = unistr2_to_ascii_talloc(ctx, &q_u->uni_share_name);
+ DEBUG(5,("_srvsvc_NetShareDel: %d\n", __LINE__));
+ share_name = talloc_strdup(p->mem_ctx, r->in.share_name);
if (!share_name) {
return WERR_NET_NAME_NOT_FOUND;
}
@@ -1953,7 +1954,7 @@ WERROR _srv_net_share_del(pipes_struct *p, SRV_Q_NET_SHARE_DEL *q_u, SRV_R_NET_S
return WERR_ACCESS_DENIED;
if (!lp_delete_share_cmd() || !*lp_delete_share_cmd()) {
- DEBUG(10,("_srv_net_share_del: No delete share command\n"));
+ DEBUG(10,("_srvsvc_NetShareDel: No delete share command\n"));
return WERR_ACCESS_DENIED;
}
@@ -1966,7 +1967,7 @@ WERROR _srv_net_share_del(pipes_struct *p, SRV_Q_NET_SHARE_DEL *q_u, SRV_R_NET_S
return WERR_NOMEM;
}
- DEBUG(10,("_srv_net_share_del: Running [%s]\n", command ));
+ DEBUG(10,("_srvsvc_NetShareDel: Running [%s]\n", command ));
/********* BEGIN SeDiskOperatorPrivilege BLOCK *********/
@@ -1984,7 +1985,7 @@ WERROR _srv_net_share_del(pipes_struct *p, SRV_Q_NET_SHARE_DEL *q_u, SRV_R_NET_S
/********* END SeDiskOperatorPrivilege BLOCK *********/
- DEBUG(3,("_srv_net_share_del: Running [%s] returned (%d)\n", command, ret ));
+ DEBUG(3,("_srvsvc_NetShareDel: Running [%s] returned (%d)\n", command, ret ));
if ( ret != 0 )
return WERR_ACCESS_DENIED;
@@ -1997,11 +1998,22 @@ WERROR _srv_net_share_del(pipes_struct *p, SRV_Q_NET_SHARE_DEL *q_u, SRV_R_NET_S
return WERR_OK;
}
-WERROR _srv_net_share_del_sticky(pipes_struct *p, SRV_Q_NET_SHARE_DEL *q_u, SRV_R_NET_SHARE_DEL *r_u)
+/*******************************************************************
+ _srvsvc_NetShareDelSticky
+********************************************************************/
+
+WERROR _srvsvc_NetShareDelSticky(pipes_struct *p,
+ struct srvsvc_NetShareDelSticky *r)
{
- DEBUG(5,("_srv_net_share_del_stick: %d\n", __LINE__));
+ struct srvsvc_NetShareDel q;
- return _srv_net_share_del(p, q_u, r_u);
+ DEBUG(5,("_srvsvc_NetShareDelSticky: %d\n", __LINE__));
+
+ q.in.server_unc = r->in.server_unc;
+ q.in.share_name = r->in.share_name;
+ q.in.reserved = r->in.reserved;
+
+ return _srvsvc_NetShareDel(p, &q);
}
/*******************************************************************
@@ -2487,18 +2499,6 @@ WERROR _srvsvc_NetShareAdd(pipes_struct *p, struct srvsvc_NetShareAdd *r)
return WERR_NOT_SUPPORTED;
}
-WERROR _srvsvc_NetShareDel(pipes_struct *p, struct srvsvc_NetShareDel *r)
-{
- p->rng_fault_state = True;
- return WERR_NOT_SUPPORTED;
-}
-
-WERROR _srvsvc_NetShareDelSticky(pipes_struct *p, struct srvsvc_NetShareDelSticky *r)
-{
- p->rng_fault_state = True;
- return WERR_NOT_SUPPORTED;
-}
-
WERROR _srvsvc_NetShareCheck(pipes_struct *p, struct srvsvc_NetShareCheck *r)
{
p->rng_fault_state = True;