summaryrefslogtreecommitdiff
path: root/source3/services/services_db.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-02-21 09:53:00 -0800
committerJeremy Allison <jra@samba.org>2008-02-21 09:53:00 -0800
commit3a376f1cfa25f79eab8f41a42383f1bd982830ff (patch)
treec79b241e6b811dd058f7791cdb561587b1533db1 /source3/services/services_db.c
parent34f23b7ea755eaef6012b653fbcff42714dddcb7 (diff)
parentbf6dbf8e1b371770a2c9df99b27569c36587df39 (diff)
downloadsamba-3a376f1cfa25f79eab8f41a42383f1bd982830ff.tar.gz
samba-3a376f1cfa25f79eab8f41a42383f1bd982830ff.tar.bz2
samba-3a376f1cfa25f79eab8f41a42383f1bd982830ff.zip
Merge branch 'v3-2-test' of ssh://jra@git.samba.org/data/git/samba into v3-2-test
(This used to be commit beb0a76b93f9dd054dbc4192516e7008e59b27d9)
Diffstat (limited to 'source3/services/services_db.c')
-rw-r--r--source3/services/services_db.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/source3/services/services_db.c b/source3/services/services_db.c
index d4e144d5ff..ae83e72697 100644
--- a/source3/services/services_db.c
+++ b/source3/services/services_db.c
@@ -469,7 +469,7 @@ void svcctl_init_keys( void )
fetch_reg_keys( key, subkeys );
- /* the builting services exist */
+ /* the builtin services exist */
for ( i=0; builtin_svcs[i].servicename; i++ )
add_new_svc_name( key, subkeys, builtin_svcs[i].servicename );
@@ -520,25 +520,21 @@ SEC_DESC *svcctl_get_secdesc( TALLOC_CTX *ctx, const char *name, NT_USER_TOKEN *
if ( !W_ERROR_IS_OK(wresult) ) {
DEBUG(0,("svcctl_get_secdesc: key lookup failed! [%s] (%s)\n",
path, dos_errstr(wresult)));
- SAFE_FREE(path);
- return NULL;
+ goto done;
}
- SAFE_FREE(path);
if ( !(values = TALLOC_ZERO_P( key, REGVAL_CTR )) ) {
DEBUG(0,("svcctl_get_secdesc: talloc() failed!\n"));
- TALLOC_FREE( key );
- return NULL;
+ goto done;
}
- fetch_reg_values( key, values );
-
- TALLOC_FREE(key);
+ if (fetch_reg_values( key, values ) == -1) {
+ DEBUG(0, ("Error getting registry values\n"));
+ goto done;
+ }
if ( !(val = regval_ctr_getvalue( values, "Security" )) ) {
- DEBUG(6,("svcctl_get_secdesc: constructing default secdesc for service [%s]\n",
- name));
- return construct_service_sd( ctx );
+ goto fallback_to_default_sd;
}
/* stream the service security descriptor */
@@ -546,10 +542,18 @@ SEC_DESC *svcctl_get_secdesc( TALLOC_CTX *ctx, const char *name, NT_USER_TOKEN *
status = unmarshall_sec_desc(ctx, regval_data_p(val),
regval_size(val), &ret_sd);
- if (!NT_STATUS_IS_OK(status)) {
- return construct_service_sd( ctx );
+ if (NT_STATUS_IS_OK(status)) {
+ goto done;
}
+fallback_to_default_sd:
+ DEBUG(6, ("svcctl_get_secdesc: constructing default secdesc for "
+ "service [%s]\n", name));
+ ret_sd = construct_service_sd(ctx);
+
+done:
+ SAFE_FREE(path);
+ TALLOC_FREE(key);
return ret_sd;
}