summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-03-09 18:01:52 +0100
committerGünther Deschner <gd@samba.org>2008-03-10 03:43:39 +0100
commitca354276ca491a413c8dfc30e9c093e71dc2e9d3 (patch)
tree1713f7a3bdcc9bbf371a5ef501799e679d7e1a71
parentad7c3455ff28d3bb2ebcb9e5b1af00cc30cb6d25 (diff)
downloadsamba-ca354276ca491a413c8dfc30e9c093e71dc2e9d3.tar.gz
samba-ca354276ca491a413c8dfc30e9c093e71dc2e9d3.tar.bz2
samba-ca354276ca491a413c8dfc30e9c093e71dc2e9d3.zip
Use pidl for _srvsvc_NetSessDel().
Guenther (This used to be commit 8a10bc13aee7c34f466fa69773694be97f0e7d85)
-rw-r--r--source3/rpc_server/srv_srvsvc.c21
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c35
2 files changed, 16 insertions, 40 deletions
diff --git a/source3/rpc_server/srv_srvsvc.c b/source3/rpc_server/srv_srvsvc.c
index 5351f93346..7579e109d4 100644
--- a/source3/rpc_server/srv_srvsvc.c
+++ b/source3/rpc_server/srv_srvsvc.c
@@ -152,26 +152,7 @@ static bool api_srv_net_sess_enum(pipes_struct *p)
static bool api_srv_net_sess_del(pipes_struct *p)
{
- SRV_Q_NET_SESS_DEL q_u;
- SRV_R_NET_SESS_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);
-
- /* grab the net server get enum */
- if (!srv_io_q_net_sess_del("", &q_u, data, 0))
- return False;
-
- /* construct reply. always indicate success */
- r_u.status = _srv_net_sess_del(p, &q_u, &r_u);
-
- /* store the response in the SMB stream */
- if (!srv_io_r_net_sess_del("", &r_u, rdata, 0))
- return False;
-
- return True;
+ return proxy_srvsvc_call(p, NDR_SRVSVC_NETSESSDEL);
}
/*******************************************************************
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index 0d4addde14..7c2efc946d 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -1274,31 +1274,33 @@ WERROR _srv_net_sess_enum(pipes_struct *p, SRV_Q_NET_SESS_ENUM *q_u, SRV_R_NET_S
}
/*******************************************************************
-net sess del
+ _srvsvc_NetSessDel
********************************************************************/
-WERROR _srv_net_sess_del(pipes_struct *p, SRV_Q_NET_SESS_DEL *q_u, SRV_R_NET_SESS_DEL *r_u)
+WERROR _srvsvc_NetSessDel(pipes_struct *p,
+ struct srvsvc_NetSessDel *r)
{
struct sessionid *session_list;
struct current_user user;
int num_sessions, snum;
- fstring username;
- fstring machine;
+ const char *username;
+ const char *machine;
bool not_root = False;
+ WERROR werr;
- rpcstr_pull_unistr2_fstring(username, &q_u->uni_user_name);
- rpcstr_pull_unistr2_fstring(machine, &q_u->uni_cli_name);
+ username = r->in.user;
+ machine = r->in.client;
/* strip leading backslashes if any */
- while (machine[0] == '\\') {
- memmove(machine, &machine[1], strlen(machine));
+ if (machine && machine[0] == '\\' && machine[1] == '\\') {
+ machine += 2;
}
num_sessions = list_sessions(p->mem_ctx, &session_list);
- DEBUG(5,("_srv_net_sess_del: %d\n", __LINE__));
+ DEBUG(5,("_srvsvc_NetSessDel: %d\n", __LINE__));
- r_u->status = WERR_ACCESS_DENIED;
+ werr = WERR_ACCESS_DENIED;
get_current_user(&user, p);
@@ -1327,19 +1329,18 @@ WERROR _srv_net_sess_del(pipes_struct *p, SRV_Q_NET_SESS_DEL *q_u, SRV_R_NET_SES
MSG_SHUTDOWN, &data_blob_null);
if (NT_STATUS_IS_OK(ntstat))
- r_u->status = WERR_OK;
+ werr = WERR_OK;
if (not_root)
unbecome_root();
}
}
- DEBUG(5,("_srv_net_sess_del: %d\n", __LINE__));
-
+ DEBUG(5,("_srvsvc_NetSessDel: %d\n", __LINE__));
done:
- return r_u->status;
+ return werr;
}
/*******************************************************************
@@ -2508,12 +2509,6 @@ WERROR _srvsvc_NetSessEnum(pipes_struct *p, struct srvsvc_NetSessEnum *r)
return WERR_NOT_SUPPORTED;
}
-WERROR _srvsvc_NetSessDel(pipes_struct *p, struct srvsvc_NetSessDel *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;