summaryrefslogtreecommitdiffstats
path: root/source3/rpc_server/srv_winreg_nt.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-11-29 10:51:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:14 -0500
commit1c91cca86eacc74c2785c54bc75c5ff18d7a773d (patch)
treefb4242243867cb1b05365dd5b46d01b89a15610c /source3/rpc_server/srv_winreg_nt.c
parent443421828a16bc33a59b43e0a2c400f51b3619a9 (diff)
downloadsamba-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/srv_winreg_nt.c')
-rw-r--r--source3/rpc_server/srv_winreg_nt.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/source3/rpc_server/srv_winreg_nt.c b/source3/rpc_server/srv_winreg_nt.c
index 52de236bce4..16c271427e7 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;
}