diff options
author | Michael Adam <obnox@samba.org> | 2010-09-20 10:30:30 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2010-09-21 06:53:31 +0200 |
commit | 3cab10975464a6f67c1728301ffc0264fb1763e0 (patch) | |
tree | f978758b9268850503f990dddc45b2a05183ee92 /source3/rpc_server | |
parent | 3c85a9fcbe56aadc6a50706d253d7d010cf91c63 (diff) | |
download | samba-3cab10975464a6f67c1728301ffc0264fb1763e0.tar.gz |
s3:srv_ntsvcs_nt: make fill_svc_config() use svcctl_get_string_value()
instead of using legacy svcctl_fetch_regvalues()
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_svcctl_nt.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/source3/rpc_server/srv_svcctl_nt.c b/source3/rpc_server/srv_svcctl_nt.c index 74f9d813beb..daf5f60710c 100644 --- a/source3/rpc_server/srv_svcctl_nt.c +++ b/source3/rpc_server/srv_svcctl_nt.c @@ -644,27 +644,21 @@ static WERROR fill_svc_config( TALLOC_CTX *ctx, const char *name, struct QUERY_SERVICE_CONFIG *config, struct security_token *token ) { - struct regval_ctr *values; - struct regval_blob *val; - - /* retrieve the registry values for this service */ - - if ( !(values = svcctl_fetch_regvalues( name, token )) ) - return WERR_REG_CORRUPT; + TALLOC_CTX *mem_ctx = talloc_stackframe(); + const char *result = NULL; /* now fill in the individual values */ - if ( (val = regval_ctr_getvalue( values, "DisplayName" )) != NULL ) - config->displayname = regval_sz(val); - else - config->displayname = name; + config->displayname = svcctl_lookup_dispname(mem_ctx, name, token); - if ( (val = regval_ctr_getvalue( values, "ObjectName" )) != NULL ) { - config->startname = regval_sz(val); + result = svcctl_get_string_value(mem_ctx, name, "ObjectName", token); + if (result != NULL) { + config->startname = result; } - if ( (val = regval_ctr_getvalue( values, "ImagePath" )) != NULL ) { - config->executablepath = regval_sz(val); + result = svcctl_get_string_value(mem_ctx, name, "ImagePath", token); + if (result != NULL) { + config->executablepath = result; } /* a few hard coded values */ @@ -686,7 +680,7 @@ static WERROR fill_svc_config( TALLOC_CTX *ctx, const char *name, config->start_type = SVCCTL_DEMAND_START; - TALLOC_FREE( values ); + talloc_free(mem_ctx); return WERR_OK; } |