summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-12-17 18:00:43 -0800
committerJeremy Allison <jra@samba.org>2007-12-17 18:00:43 -0800
commite3efe7cd7e11be5a78ddce9a49316b516ab81ba3 (patch)
tree08e16e20e0f3146b71a6271479c9f375422e4ba9 /source3/rpc_server
parent192aae0564c641fa06f90a064c033fa52d8cf549 (diff)
downloadsamba-e3efe7cd7e11be5a78ddce9a49316b516ab81ba3.tar.gz
samba-e3efe7cd7e11be5a78ddce9a49316b516ab81ba3.tar.bz2
samba-e3efe7cd7e11be5a78ddce9a49316b516ab81ba3.zip
More static fstring elimination.
Jeremy. (This used to be commit b4dfec09e89428cac9b21a94ce4d24e60d4a54f4)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_svcctl_nt.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/source3/rpc_server/srv_svcctl_nt.c b/source3/rpc_server/srv_svcctl_nt.c
index 7d81033264..5316d399b9 100644
--- a/source3/rpc_server/srv_svcctl_nt.c
+++ b/source3/rpc_server/srv_svcctl_nt.c
@@ -346,8 +346,8 @@ WERROR _svcctl_get_display_name(pipes_struct *p, SVCCTL_Q_GET_DISPLAY_NAME *q_u,
rpcstr_pull(service, q_u->servicename.buffer, sizeof(service), q_u->servicename.uni_str_len*2, 0);
- display_name = svcctl_lookup_dispname( service, p->pipe_user.nt_user_token );
- init_svcctl_r_get_display_name( r_u, display_name );
+ display_name = svcctl_lookup_dispname(p->mem_ctx, service, p->pipe_user.nt_user_token );
+ init_svcctl_r_get_display_name( r_u, display_name ? display_name : "");
return WERR_OK;
}
@@ -394,8 +394,8 @@ static int enumerate_status( TALLOC_CTX *ctx, ENUM_SERVICES_STATUS **status, NT_
for ( i=0; i<num_services; i++ ) {
init_unistr( &st[i].servicename, svcctl_ops[i].name );
- display_name = svcctl_lookup_dispname( svcctl_ops[i].name, token );
- init_unistr( &st[i].displayname, display_name );
+ display_name = svcctl_lookup_dispname(ctx, svcctl_ops[i].name, token );
+ init_unistr( &st[i].displayname, display_name ? display_name : "");
svcctl_ops[i].ops->service_status( svcctl_ops[i].name, &st[i].status );
}
@@ -688,16 +688,16 @@ WERROR _svcctl_query_service_config2( pipes_struct *p, SVCCTL_Q_QUERY_SERVICE_CO
{
SERVICE_INFO *info = find_service_info_by_hnd( p, &q_u->handle );
uint32 buffer_size;
-
+
/* perform access checks */
if ( !info || (info->type != SVC_HANDLE_IS_SERVICE) )
- return WERR_BADFID;
-
+ return WERR_BADFID;
+
if ( !(info->access_granted & SC_RIGHT_SVC_QUERY_CONFIG) )
return WERR_ACCESS_DENIED;
-
- /* we have to set the outgoing buffer size to the same as the
+
+ /* we have to set the outgoing buffer size to the same as the
incoming buffer size (even in the case of failure */
rpcbuf_init( &r_u->buffer, q_u->buffer_size, p->mem_ctx );
@@ -708,12 +708,12 @@ WERROR _svcctl_query_service_config2( pipes_struct *p, SVCCTL_Q_QUERY_SERVICE_CO
{
SERVICE_DESCRIPTION desc_buf;
const char *description;
-
- description = svcctl_lookup_description( info->name, p->pipe_user.nt_user_token );
-
+
+ description = svcctl_lookup_description(p->mem_ctx, info->name, p->pipe_user.nt_user_token );
+
ZERO_STRUCTP( &desc_buf );
- init_service_description_buffer( &desc_buf, description );
+ init_service_description_buffer( &desc_buf, description ? description : "");
svcctl_io_service_description( "", &desc_buf, &r_u->buffer, 0 );
buffer_size = svcctl_sizeof_service_description( &desc_buf );
@@ -737,7 +737,7 @@ WERROR _svcctl_query_service_config2( pipes_struct *p, SVCCTL_Q_QUERY_SERVICE_CO
default:
return WERR_UNKNOWN_LEVEL;
}
-
+
buffer_size += buffer_size % 4;
r_u->needed = (buffer_size > q_u->buffer_size) ? buffer_size : q_u->buffer_size;