summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_svcctl_nt.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-10-17 15:57:07 +1100
committerAndrew Bartlett <abartlet@samba.org>2008-10-17 15:57:07 +1100
commitc35b0d9ab5d01e37cb06d02083a329e18ae59566 (patch)
tree20dd5885cf3da8d030ef69ab0d32bd2fb4207777 /source3/rpc_server/srv_svcctl_nt.c
parent4fb64f13d5101c960a7a234ff2b0b79283de5589 (diff)
parentc783d8a32e4d958aec6d943d0fa3de2e7d3a68c2 (diff)
downloadsamba-c35b0d9ab5d01e37cb06d02083a329e18ae59566.tar.gz
samba-c35b0d9ab5d01e37cb06d02083a329e18ae59566.tar.bz2
samba-c35b0d9ab5d01e37cb06d02083a329e18ae59566.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba into master-devel
Diffstat (limited to 'source3/rpc_server/srv_svcctl_nt.c')
-rw-r--r--source3/rpc_server/srv_svcctl_nt.c40
1 files changed, 18 insertions, 22 deletions
diff --git a/source3/rpc_server/srv_svcctl_nt.c b/source3/rpc_server/srv_svcctl_nt.c
index 1caf4941a4..a7215ac686 100644
--- a/source3/rpc_server/srv_svcctl_nt.c
+++ b/source3/rpc_server/srv_svcctl_nt.c
@@ -6,6 +6,7 @@
*
* Largely Rewritten (Again) by:
* Copyright (C) Gerald (Jerry) Carter 2005.
+ * Copyright (C) Guenther Deschner 2008.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -610,7 +611,9 @@ WERROR _svcctl_query_service_status_ex( pipes_struct *p, SVCCTL_Q_QUERY_SERVICE_
/********************************************************************
********************************************************************/
-static WERROR fill_svc_config( TALLOC_CTX *ctx, const char *name, SERVICE_CONFIG *config, NT_USER_TOKEN *token )
+static WERROR fill_svc_config( TALLOC_CTX *ctx, const char *name,
+ struct QUERY_SERVICE_CONFIG *config,
+ NT_USER_TOKEN *token )
{
REGVAL_CTR *values;
REGISTRY_VALUE *val;
@@ -622,20 +625,17 @@ static WERROR fill_svc_config( TALLOC_CTX *ctx, const char *name, SERVICE_CONFIG
/* now fill in the individual values */
- config->displayname = TALLOC_ZERO_P( ctx, UNISTR2 );
if ( (val = regval_ctr_getvalue( values, "DisplayName" )) != NULL )
- init_unistr2( config->displayname, regval_sz( val ), UNI_STR_TERMINATE );
+ config->displayname = regval_sz(val);
else
- init_unistr2( config->displayname, name, UNI_STR_TERMINATE );
+ config->displayname = name;
if ( (val = regval_ctr_getvalue( values, "ObjectName" )) != NULL ) {
- config->startname = TALLOC_ZERO_P( ctx, UNISTR2 );
- init_unistr2( config->startname, regval_sz( val ), UNI_STR_TERMINATE );
+ config->startname = regval_sz(val);
}
if ( (val = regval_ctr_getvalue( values, "ImagePath" )) != NULL ) {
- config->executablepath = TALLOC_ZERO_P( ctx, UNISTR2 );
- init_unistr2( config->executablepath, regval_sz( val ), UNI_STR_TERMINATE );
+ config->executablepath = regval_sz(val);
}
/* a few hard coded values */
@@ -663,11 +663,13 @@ static WERROR fill_svc_config( TALLOC_CTX *ctx, const char *name, SERVICE_CONFIG
}
/********************************************************************
+ _svcctl_QueryServiceConfigW
********************************************************************/
-WERROR _svcctl_query_service_config( pipes_struct *p, SVCCTL_Q_QUERY_SERVICE_CONFIG *q_u, SVCCTL_R_QUERY_SERVICE_CONFIG *r_u )
+WERROR _svcctl_QueryServiceConfigW(pipes_struct *p,
+ struct svcctl_QueryServiceConfigW *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 );
uint32 buffer_size;
WERROR wresult;
@@ -682,17 +684,17 @@ WERROR _svcctl_query_service_config( pipes_struct *p, SVCCTL_Q_QUERY_SERVICE_CON
/* we have to set the outgoing buffer size to the same as the
incoming buffer size (even in the case of failure */
- r_u->needed = q_u->buffer_size;
+ *r->out.bytes_needed = r->in.buf_size;
- wresult = fill_svc_config( p->mem_ctx, info->name, &r_u->config, p->pipe_user.nt_user_token );
+ wresult = fill_svc_config( p->mem_ctx, info->name, r->out.query, p->pipe_user.nt_user_token );
if ( !W_ERROR_IS_OK(wresult) )
return wresult;
- buffer_size = svcctl_sizeof_service_config( &r_u->config );
- r_u->needed = (buffer_size > q_u->buffer_size) ? buffer_size : q_u->buffer_size;
+ buffer_size = ndr_size_QUERY_SERVICE_CONFIG(r->out.query, 0);
+ *r->out.bytes_needed = (buffer_size > r->in.buf_size) ? buffer_size : r->in.buf_size;
- if (buffer_size > q_u->buffer_size ) {
- ZERO_STRUCTP( &r_u->config );
+ if (buffer_size > r->in.buf_size ) {
+ TALLOC_FREE(r->out.query);
return WERR_INSUFFICIENT_BUFFER;
}
@@ -956,12 +958,6 @@ WERROR _svcctl_EnumServicesStatusW(pipes_struct *p, struct svcctl_EnumServicesSt
return WERR_NOT_SUPPORTED;
}
-WERROR _svcctl_QueryServiceConfigW(pipes_struct *p, struct svcctl_QueryServiceConfigW *r)
-{
- p->rng_fault_state = True;
- return WERR_NOT_SUPPORTED;
-}
-
WERROR _svcctl_QueryServiceLockStatusW(pipes_struct *p, struct svcctl_QueryServiceLockStatusW *r)
{
p->rng_fault_state = True;