Move drop_smbconf_internal() to libnet_conf.c
authorMichael Adam <obnox@samba.org>
Tue, 25 Dec 2007 01:55:07 +0000 (02:55 +0100)
committerMichael Adam <obnox@samba.org>
Tue, 25 Dec 2007 01:55:07 +0000 (02:55 +0100)
Michael
(This used to be commit 4c2a3396bb687703f6b74655fda2014d1f75200b)

source3/libnet/libnet_conf.c
source3/utils/net_conf.c

index 4c5a0829d6a947a16acbba0f5f0b547a931e87d4..e81b8b4111ee338e3f03907a9cf999c8323f2393 100644 (file)
@@ -243,6 +243,56 @@ done:
  *
  **********************************************************************/
 
+WERROR drop_smbconf_internal(TALLOC_CTX *ctx)
+{
+       char *path, *p;
+       WERROR werr = WERR_OK;
+       NT_USER_TOKEN *token;
+       struct registry_key *parent_key = NULL;
+       struct registry_key *new_key = NULL;
+       TALLOC_CTX* tmp_ctx = NULL;
+       enum winreg_CreateAction action;
+
+       tmp_ctx = talloc_new(ctx);
+       if (tmp_ctx == NULL) {
+               werr = WERR_NOMEM;
+               goto done;
+       }
+
+       if (!(token = registry_create_admin_token(tmp_ctx))) {
+               /* what is the appropriate error code here? */
+               werr = WERR_CAN_NOT_COMPLETE;
+               goto done;
+       }
+
+       path = talloc_strdup(tmp_ctx, KEY_SMBCONF);
+       if (path == NULL) {
+               d_fprintf(stderr, "ERROR: out of memory!\n");
+               werr = WERR_NOMEM;
+               goto done;
+       }
+       p = strrchr(path, '\\');
+       *p = '\0';
+       werr = reg_open_path(tmp_ctx, path, REG_KEY_WRITE, token, &parent_key);
+
+       if (!W_ERROR_IS_OK(werr)) {
+               goto done;
+       }
+
+       werr = reg_deletekey_recursive(tmp_ctx, parent_key, p+1);
+
+       if (!W_ERROR_IS_OK(werr)) {
+               goto done;
+       }
+
+       werr = reg_createkey(tmp_ctx, parent_key, p+1, REG_KEY_WRITE,
+                            &new_key, &action);
+
+done:
+       TALLOC_FREE(tmp_ctx);
+       return werr;
+}
+
 /**
  * delete a service from configuration
  */
index a10f9830259654d346cdb642c81967695a175388..e46ff758efa94898ae5e8ce7e75c3cf8d1257591 100644 (file)
@@ -168,56 +168,6 @@ done:
        return werr;
 }
 
-static WERROR drop_smbconf_internal(TALLOC_CTX *ctx)
-{
-       char *path, *p;
-       WERROR werr = WERR_OK;
-       NT_USER_TOKEN *token;
-       struct registry_key *parent_key = NULL;
-       struct registry_key *new_key = NULL;
-       TALLOC_CTX* tmp_ctx = NULL;
-       enum winreg_CreateAction action;
-
-       tmp_ctx = talloc_new(ctx);
-       if (tmp_ctx == NULL) {
-               werr = WERR_NOMEM;
-               goto done;
-       }
-
-       if (!(token = registry_create_admin_token(tmp_ctx))) {
-               /* what is the appropriate error code here? */
-               werr = WERR_CAN_NOT_COMPLETE;
-               goto done;
-       }
-
-       path = talloc_strdup(tmp_ctx, KEY_SMBCONF);
-       if (path == NULL) {
-               d_fprintf(stderr, "ERROR: out of memory!\n");
-               werr = WERR_NOMEM;
-               goto done;
-       }
-       p = strrchr(path, '\\');
-       *p = '\0';
-       werr = reg_open_path(tmp_ctx, path, REG_KEY_WRITE, token, &parent_key);
-
-       if (!W_ERROR_IS_OK(werr)) {
-               goto done;
-       }
-
-       werr = reg_deletekey_recursive(tmp_ctx, parent_key, p+1);
-
-       if (!W_ERROR_IS_OK(werr)) {
-               goto done;
-       }
-
-       werr = reg_createkey(tmp_ctx, parent_key, p+1, REG_KEY_WRITE,
-                            &new_key, &action);
-
-done:
-       TALLOC_FREE(tmp_ctx);
-       return werr;
-}
-
 static char *parm_valstr(TALLOC_CTX *ctx, struct parm_struct *parm,
                         struct share_params *share)
 {