summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-28 00:33:06 +0100
committerGünther Deschner <gd@samba.org>2008-02-28 00:43:31 +0100
commitc86cbd736957b6d5f3c3f648ce07c593fd60af99 (patch)
tree76741316081e4d2b944db5d4d5127980042a6b86 /source3/rpc_server
parent8b23d4a6c3e615015ef230070a3f4f9ee5095d2a (diff)
downloadsamba-c86cbd736957b6d5f3c3f648ce07c593fd60af99.tar.gz
samba-c86cbd736957b6d5f3c3f648ce07c593fd60af99.tar.bz2
samba-c86cbd736957b6d5f3c3f648ce07c593fd60af99.zip
Use pidl for _svcctl_SetServiceObjectSecurity().
Guenther (This used to be commit 19048ab4ad1b262536efae5b8b8b4411ec088921)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_svcctl.c18
-rw-r--r--source3/rpc_server/srv_svcctl_nt.c23
2 files changed, 13 insertions, 28 deletions
diff --git a/source3/rpc_server/srv_svcctl.c b/source3/rpc_server/srv_svcctl.c
index 2c594ace8c..5e125145d6 100644
--- a/source3/rpc_server/srv_svcctl.c
+++ b/source3/rpc_server/srv_svcctl.c
@@ -244,23 +244,7 @@ static bool api_svcctl_query_security_sec(pipes_struct *p)
static bool api_svcctl_set_security_sec(pipes_struct *p)
{
- SVCCTL_Q_SET_SERVICE_SEC q_u;
- SVCCTL_R_SET_SERVICE_SEC r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if(!svcctl_io_q_set_service_sec("", &q_u, data, 0))
- return False;
-
- r_u.status = _svcctl_set_service_sec(p, &q_u, &r_u);
-
- if(!svcctl_io_r_set_service_sec("", &r_u, rdata, 0))
- return False;
-
- return True;
+ return proxy_svcctl_call(p, NDR_SVCCTL_SETSERVICEOBJECTSECURITY);
}
diff --git a/source3/rpc_server/srv_svcctl_nt.c b/source3/rpc_server/srv_svcctl_nt.c
index 2672647c1d..73d09b1bbb 100644
--- a/source3/rpc_server/srv_svcctl_nt.c
+++ b/source3/rpc_server/srv_svcctl_nt.c
@@ -854,13 +854,16 @@ WERROR _svcctl_QueryServiceObjectSecurity(pipes_struct *p,
}
/********************************************************************
+ _svcctl_SetServiceObjectSecurity
********************************************************************/
-WERROR _svcctl_set_service_sec( pipes_struct *p, SVCCTL_Q_SET_SERVICE_SEC *q_u, SVCCTL_R_SET_SERVICE_SEC *r_u )
+WERROR _svcctl_SetServiceObjectSecurity(pipes_struct *p,
+ struct svcctl_SetServiceObjectSecurity *r)
{
- SERVICE_INFO *info = find_service_info_by_hnd( p, &q_u->handle );
+ SERVICE_INFO *info = find_service_info_by_hnd( p, r->in.handle );
SEC_DESC *sec_desc = NULL;
uint32 required_access;
+ NTSTATUS status;
if ( !info || !(info->type & (SVC_HANDLE_IS_SERVICE|SVC_HANDLE_IS_SCM)) )
return WERR_BADFID;
@@ -872,7 +875,7 @@ WERROR _svcctl_set_service_sec( pipes_struct *p, SVCCTL_Q_SET_SERVICE_SEC *q_u,
/* check the access on the open handle */
- switch ( q_u->security_flags ) {
+ switch ( r->in.security_flags ) {
case DACL_SECURITY_INFORMATION:
required_access = STD_RIGHT_WRITE_DAC_ACCESS;
break;
@@ -893,8 +896,12 @@ WERROR _svcctl_set_service_sec( pipes_struct *p, SVCCTL_Q_SET_SERVICE_SEC *q_u,
/* read the security descfriptor */
- if ( !sec_io_desc("", &sec_desc, &q_u->buffer.prs, 0 ) )
- return WERR_NOMEM;
+ status = unmarshall_sec_desc(p->mem_ctx,
+ r->in.buffer, r->in.buffer_size,
+ &sec_desc);
+ if (!NT_STATUS_IS_OK(status)) {
+ return ntstatus_to_werror(status);
+ }
/* store the new SD */
@@ -911,12 +918,6 @@ WERROR _svcctl_DeleteService(pipes_struct *p, struct svcctl_DeleteService *r)
return WERR_NOT_SUPPORTED;
}
-WERROR _svcctl_SetServiceObjectSecurity(pipes_struct *p, struct svcctl_SetServiceObjectSecurity *r)
-{
- p->rng_fault_state = True;
- return WERR_NOT_SUPPORTED;
-}
-
WERROR _svcctl_SetServiceStatus(pipes_struct *p, struct svcctl_SetServiceStatus *r)
{
p->rng_fault_state = True;