summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-11-19 10:50:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:55 -0500
commitcb7f4211b8441642dce9594522dc9588475a7719 (patch)
treed384f0738dfc3b7b8b766f41f7a16eab8b219ac2
parent17c7c337f64b082c1bf1045a4093c279deeec958 (diff)
downloadsamba-cb7f4211b8441642dce9594522dc9588475a7719.tar.gz
samba-cb7f4211b8441642dce9594522dc9588475a7719.tar.xz
samba-cb7f4211b8441642dce9594522dc9588475a7719.zip
r19778: Make regkey_open_internal take a talloc ctx
-rw-r--r--source/registry/reg_frontend.c5
-rw-r--r--source/rpc_server/srv_eventlog_nt.c5
-rw-r--r--source/rpc_server/srv_winreg_nt.c4
-rw-r--r--source/services/services_db.c25
4 files changed, 22 insertions, 17 deletions
diff --git a/source/registry/reg_frontend.c b/source/registry/reg_frontend.c
index d5a9d45e8c4..14531b52f72 100644
--- a/source/registry/reg_frontend.c
+++ b/source/registry/reg_frontend.c
@@ -345,7 +345,8 @@ BOOL regkey_access_check( REGISTRY_KEY *key, uint32 requested, uint32 *granted,
/***********************************************************************
***********************************************************************/
-WERROR regkey_open_internal( REGISTRY_KEY **regkey, const char *path,
+WERROR regkey_open_internal( TALLOC_CTX *mem_ctx,
+ REGISTRY_KEY **regkey, const char *path,
NT_USER_TOKEN *token, uint32 access_desired )
{
WERROR result = WERR_OK;
@@ -358,7 +359,7 @@ WERROR regkey_open_internal( REGISTRY_KEY **regkey, const char *path,
DEBUG(7,("regkey_open_internal: name = [%s]\n", path));
- if ( !(*regkey = TALLOC_ZERO_P(NULL, REGISTRY_KEY)) ) {
+ if ( !(*regkey = TALLOC_ZERO_P(mem_ctx, REGISTRY_KEY)) ) {
regdb_close();
return WERR_NOMEM;
}
diff --git a/source/rpc_server/srv_eventlog_nt.c b/source/rpc_server/srv_eventlog_nt.c
index ec07981de9a..ba366ed9832 100644
--- a/source/rpc_server/srv_eventlog_nt.c
+++ b/source/rpc_server/srv_eventlog_nt.c
@@ -411,9 +411,8 @@ static BOOL sync_eventlog_params( EVENTLOG_INFO *info )
pstr_sprintf( path, "%s/%s", KEY_EVENTLOG, elogname );
- wresult =
- regkey_open_internal( &keyinfo, path, get_root_nt_token( ),
- REG_KEY_READ );
+ wresult = regkey_open_internal(
+ NULL, &keyinfo, path, get_root_nt_token(), REG_KEY_READ );
if ( !W_ERROR_IS_OK( wresult ) ) {
DEBUG( 4,
diff --git a/source/rpc_server/srv_winreg_nt.c b/source/rpc_server/srv_winreg_nt.c
index 1a130f19b6a..ebf825b6841 100644
--- a/source/rpc_server/srv_winreg_nt.c
+++ b/source/rpc_server/srv_winreg_nt.c
@@ -86,7 +86,9 @@ static WERROR open_registry_key( pipes_struct *p, POLICY_HND *hnd,
/* now do the internal open */
- result = regkey_open_internal( keyinfo, keypath, p->pipe_user.nt_user_token, access_desired );
+ result = regkey_open_internal( NULL, keyinfo, keypath,
+ p->pipe_user.nt_user_token,
+ access_desired );
if ( !W_ERROR_IS_OK(result) )
return result;
diff --git a/source/services/services_db.c b/source/services/services_db.c
index 5b4f58d766d..7573d3ba2dc 100644
--- a/source/services/services_db.c
+++ b/source/services/services_db.c
@@ -322,8 +322,8 @@ static void add_new_svc_name( REGISTRY_KEY *key_parent, REGSUBKEY_CTR *subkeys,
/* open the new service key */
pstr_sprintf( path, "%s\\%s", KEY_SERVICES, name );
- wresult = regkey_open_internal( &key_service, path, get_root_nt_token(),
- REG_KEY_ALL );
+ wresult = regkey_open_internal( NULL, &key_service, path,
+ get_root_nt_token(), REG_KEY_ALL );
if ( !W_ERROR_IS_OK(wresult) ) {
DEBUG(0,("add_new_svc_name: key lookup failed! [%s] (%s)\n",
path, dos_errstr(wresult)));
@@ -360,8 +360,8 @@ static void add_new_svc_name( REGISTRY_KEY *key_parent, REGSUBKEY_CTR *subkeys,
/* now add the security descriptor */
pstr_sprintf( path, "%s\\%s\\%s", KEY_SERVICES, name, "Security" );
- wresult = regkey_open_internal( &key_secdesc, path, get_root_nt_token(),
- REG_KEY_ALL );
+ wresult = regkey_open_internal( NULL, &key_secdesc, path,
+ get_root_nt_token(), REG_KEY_ALL );
if ( !W_ERROR_IS_OK(wresult) ) {
DEBUG(0,("add_new_svc_name: key lookup failed! [%s] (%s)\n",
path, dos_errstr(wresult)));
@@ -412,8 +412,8 @@ void svcctl_init_keys( void )
/* bad mojo here if the lookup failed. Should not happen */
- wresult = regkey_open_internal( &key, KEY_SERVICES, get_root_nt_token(),
- REG_KEY_ALL );
+ wresult = regkey_open_internal( NULL, &key, KEY_SERVICES,
+ get_root_nt_token(), REG_KEY_ALL );
if ( !W_ERROR_IS_OK(wresult) ) {
DEBUG(0,("init_services_keys: key lookup failed! (%s)\n",
@@ -476,7 +476,7 @@ SEC_DESC* svcctl_get_secdesc( TALLOC_CTX *ctx, const char *name, NT_USER_TOKEN *
/* now add the security descriptor */
pstr_sprintf( path, "%s\\%s\\%s", KEY_SERVICES, name, "Security" );
- wresult = regkey_open_internal( &key, path, token, REG_KEY_ALL );
+ wresult = regkey_open_internal( NULL, &key, path, token, REG_KEY_ALL );
if ( !W_ERROR_IS_OK(wresult) ) {
DEBUG(0,("svcctl_get_secdesc: key lookup failed! [%s] (%s)\n",
path, dos_errstr(wresult)));
@@ -535,7 +535,7 @@ BOOL svcctl_set_secdesc( TALLOC_CTX *ctx, const char *name, SEC_DESC *sec_desc,
/* now add the security descriptor */
pstr_sprintf( path, "%s\\%s\\%s", KEY_SERVICES, name, "Security" );
- wresult = regkey_open_internal( &key, path, token, REG_KEY_ALL );
+ wresult = regkey_open_internal( NULL, &key, path, token, REG_KEY_ALL );
if ( !W_ERROR_IS_OK(wresult) ) {
DEBUG(0,("svcctl_get_secdesc: key lookup failed! [%s] (%s)\n",
path, dos_errstr(wresult)));
@@ -581,7 +581,8 @@ char* svcctl_lookup_dispname( const char *name, NT_USER_TOKEN *token )
/* now add the security descriptor */
pstr_sprintf( path, "%s\\%s", KEY_SERVICES, name );
- wresult = regkey_open_internal( &key, path, token, REG_KEY_READ );
+ wresult = regkey_open_internal( NULL, &key, path, token,
+ REG_KEY_READ );
if ( !W_ERROR_IS_OK(wresult) ) {
DEBUG(0,("svcctl_lookup_dispname: key lookup failed! [%s] (%s)\n",
path, dos_errstr(wresult)));
@@ -627,7 +628,8 @@ char* svcctl_lookup_description( const char *name, NT_USER_TOKEN *token )
/* now add the security descriptor */
pstr_sprintf( path, "%s\\%s", KEY_SERVICES, name );
- wresult = regkey_open_internal( &key, path, token, REG_KEY_READ );
+ wresult = regkey_open_internal( NULL, &key, path, token,
+ REG_KEY_READ );
if ( !W_ERROR_IS_OK(wresult) ) {
DEBUG(0,("svcctl_lookup_dispname: key lookup failed! [%s] (%s)\n",
path, dos_errstr(wresult)));
@@ -666,7 +668,8 @@ REGVAL_CTR* svcctl_fetch_regvalues( const char *name, NT_USER_TOKEN *token )
/* now add the security descriptor */
pstr_sprintf( path, "%s\\%s", KEY_SERVICES, name );
- wresult = regkey_open_internal( &key, path, token, REG_KEY_READ );
+ wresult = regkey_open_internal( NULL, &key, path, token,
+ REG_KEY_READ );
if ( !W_ERROR_IS_OK(wresult) ) {
DEBUG(0,("svcctl_fetch_regvalues: key lookup failed! [%s] (%s)\n",
path, dos_errstr(wresult)));