summaryrefslogtreecommitdiff
path: root/source3/services
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-09-30 20:00:52 +0200
committerGünther Deschner <gd@samba.org>2009-10-01 11:40:30 +0200
commitad836c4d48e7c7a8a6f1d240f20cca730487a651 (patch)
treeaeab897279f88524727cc4c7703ff5e1dca77938 /source3/services
parent98245727c9a314849248e5419b347b444e79a2f7 (diff)
downloadsamba-ad836c4d48e7c7a8a6f1d240f20cca730487a651.tar.gz
s3-registry: use pull_reg_sz() where appropriate.
(and move away from rpcstr_pull and rpcstr_pull_talloc). Guenther
Diffstat (limited to 'source3/services')
-rw-r--r--source3/services/services_db.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/services/services_db.c b/source3/services/services_db.c
index b36774484d6..b610c922a9d 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;