From ad836c4d48e7c7a8a6f1d240f20cca730487a651 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 30 Sep 2009 20:00:52 +0200 Subject: s3-registry: use pull_reg_sz() where appropriate. (and move away from rpcstr_pull and rpcstr_pull_talloc). Guenther --- source3/services/services_db.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'source3/services/services_db.c') diff --git a/source3/services/services_db.c b/source3/services/services_db.c index b36774484d..b610c922a9 100644 --- a/source3/services/services_db.c +++ b/source3/services/services_db.c @@ -611,12 +611,13 @@ bool svcctl_set_secdesc( TALLOC_CTX *ctx, const char *name, SEC_DESC *sec_desc, const char *svcctl_lookup_dispname(TALLOC_CTX *ctx, const char *name, NT_USER_TOKEN *token ) { - char *display_name = NULL; + const char *display_name = NULL; struct registry_key_handle *key = NULL; struct regval_ctr *values = NULL; struct regval_blob *val = NULL; char *path = NULL; WERROR wresult; + DATA_BLOB blob; /* now add the security descriptor */ @@ -644,7 +645,8 @@ const char *svcctl_lookup_dispname(TALLOC_CTX *ctx, const char *name, NT_USER_TO if ( !(val = regval_ctr_getvalue( values, "DisplayName" )) ) goto fail; - rpcstr_pull_talloc(ctx, &display_name, regval_data_p(val), regval_size(val), 0 ); + blob = data_blob_const(regval_data_p(val), regval_size(val)); + pull_reg_sz(ctx, &blob, &display_name); TALLOC_FREE( key ); @@ -661,12 +663,13 @@ fail: const char *svcctl_lookup_description(TALLOC_CTX *ctx, const char *name, NT_USER_TOKEN *token ) { - char *description = NULL; + const char *description = NULL; struct registry_key_handle *key = NULL; struct regval_ctr *values = NULL; struct regval_blob *val = NULL; char *path = NULL; WERROR wresult; + DATA_BLOB blob; /* now add the security descriptor */ @@ -695,7 +698,10 @@ const char *svcctl_lookup_description(TALLOC_CTX *ctx, const char *name, NT_USER TALLOC_FREE( key ); return "Unix Service"; } - rpcstr_pull_talloc(ctx, &description, regval_data_p(val), regval_size(val), 0 ); + + blob = data_blob_const(regval_data_p(val), regval_size(val)); + pull_reg_sz(ctx, &blob, &description); + TALLOC_FREE(key); return description; -- cgit