Use libnet_smbconf_reg_open_path() in libnet_smbconf_drop().
authorMichael Adam <obnox@samba.org>
Thu, 3 Jan 2008 00:12:23 +0000 (01:12 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 3 Jan 2008 00:29:43 +0000 (01:29 +0100)
Replaces creation of token and direct use of reg_open_path.

Michael
(This used to be commit 7e407e18be0761e7004acfbd2376c3a435922c25)

source3/libnet/libnet_conf.c

index 0bc7c63471326dbd4558a43f77ded84c42c31a14..ca5b0c408fb9addc1258adc17ea4fa9783da443c 100644 (file)
@@ -395,13 +395,6 @@ WERROR libnet_smbconf_drop(void)
        TALLOC_CTX* mem_ctx = talloc_stackframe();
        enum winreg_CreateAction action;
 
        TALLOC_CTX* mem_ctx = talloc_stackframe();
        enum winreg_CreateAction action;
 
-       if (!(token = registry_create_admin_token(mem_ctx))) {
-               DEBUG(1, ("Error creating admin token\n"));
-               /* what is the appropriate error code here? */
-               werr = WERR_CAN_NOT_COMPLETE;
-               goto done;
-       }
-
        path = talloc_strdup(mem_ctx, KEY_SMBCONF);
        if (path == NULL) {
                werr = WERR_NOMEM;
        path = talloc_strdup(mem_ctx, KEY_SMBCONF);
        if (path == NULL) {
                werr = WERR_NOMEM;
@@ -409,7 +402,8 @@ WERROR libnet_smbconf_drop(void)
        }
        p = strrchr(path, '\\');
        *p = '\0';
        }
        p = strrchr(path, '\\');
        *p = '\0';
-       werr = reg_open_path(mem_ctx, path, REG_KEY_WRITE, token, &parent_key);
+       werr = libnet_smbconf_reg_open_path(mem_ctx, path, REG_KEY_WRITE,
+                                           &parent_key);
 
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
 
        if (!W_ERROR_IS_OK(werr)) {
                goto done;