diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-11-29 10:51:00 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:16:14 -0500 |
commit | 1c91cca86eacc74c2785c54bc75c5ff18d7a773d (patch) | |
tree | fb4242243867cb1b05365dd5b46d01b89a15610c /source3/rpc_server | |
parent | 443421828a16bc33a59b43e0a2c400f51b3619a9 (diff) | |
download | samba-1c91cca86eacc74c2785c54bc75c5ff18d7a773d.tar.gz samba-1c91cca86eacc74c2785c54bc75c5ff18d7a773d.tar.xz samba-1c91cca86eacc74c2785c54bc75c5ff18d7a773d.zip |
r19947: Change regkey_open_internal to take the parent key and a talloc_ctx as
arguments. This also replaces regkey_close_internal by TALLOC_FREE.
Volker
(This used to be commit a177bbb2d5611f03cec25b7577c2e6a542f94a69)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_eventlog_nt.c | 7 | ||||
-rw-r--r-- | source3/rpc_server/srv_winreg_nt.c | 19 |
2 files changed, 4 insertions, 22 deletions
diff --git a/source3/rpc_server/srv_eventlog_nt.c b/source3/rpc_server/srv_eventlog_nt.c index ec07981de9..73dfd42184 100644 --- a/source3/rpc_server/srv_eventlog_nt.c +++ b/source3/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, NULL, &keyinfo, path, + get_root_nt_token( ), REG_KEY_READ ); if ( !W_ERROR_IS_OK( wresult ) ) { DEBUG( 4, @@ -436,7 +435,7 @@ static BOOL sync_eventlog_params( EVENTLOG_INFO *info ) if ( ( val = regval_ctr_getvalue( values, "MaxSize" ) ) != NULL ) uiMaxSize = IVAL( regval_data_p( val ), 0 ); - regkey_close_internal( keyinfo ); + TALLOC_FREE( keyinfo ); tdb_store_int32( ELOG_TDB_CTX(info->etdb), EVT_MAXSIZE, uiMaxSize ); tdb_store_int32( ELOG_TDB_CTX(info->etdb), EVT_RETENTION, uiRetention ); diff --git a/source3/rpc_server/srv_winreg_nt.c b/source3/rpc_server/srv_winreg_nt.c index 52de236bce..16c271427e 100644 --- a/source3/rpc_server/srv_winreg_nt.c +++ b/source3/rpc_server/srv_winreg_nt.c @@ -43,7 +43,6 @@ struct regkey_info { static void free_regkey_info(void *ptr) { struct regkey_info *info = (struct regkey_info *)ptr; - regkey_close_internal( info->key ); TALLOC_FREE(info); } @@ -107,36 +106,21 @@ static WERROR open_registry_key( pipes_struct *p, POLICY_HND *hnd, const char *subkeyname, uint32 access_desired ) { - char *keypath; - int path_len; WERROR result = WERR_OK; struct regkey_info *info; /* create a full registry path and strip any trailing '\' characters */ - if (asprintf(&keypath, "%s%s%s", - parent ? parent->name : "", - parent ? "\\" : "", - subkeyname) == -1) { - return WERR_NOMEM; - } - - path_len = strlen( keypath ); - if ( path_len && keypath[path_len-1] == '\\' ) - keypath[path_len-1] = '\0'; - if (!(info = TALLOC_ZERO_P(NULL, struct regkey_info))) { - SAFE_FREE(keypath); return WERR_NOMEM; } /* now do the internal open */ - result = regkey_open_internal( &info->key, keypath, + result = regkey_open_internal( info, parent, &info->key, subkeyname, p->pipe_user.nt_user_token, access_desired ); - SAFE_FREE(keypath); if ( !W_ERROR_IS_OK(result) ) { TALLOC_FREE(info); @@ -144,7 +128,6 @@ static WERROR open_registry_key( pipes_struct *p, POLICY_HND *hnd, } if ( !create_policy_hnd( p, hnd, free_regkey_info, info ) ) { - regkey_close_internal( info->key ); TALLOC_FREE(info); return WERR_BADFILE; } |