s3-registry: remove reg_pull_multi_sz().
authorGünther Deschner <gd@samba.org>
Tue, 24 Nov 2009 14:26:08 +0000 (15:26 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 24 Nov 2009 14:47:59 +0000 (15:47 +0100)
Guenther

source3/include/proto.h
source3/lib/util_reg.c
source3/lib/util_reg_api.c

index 8951e73e13dcb08375c32bce839f4cbd8953f080..6b68f954e4a006968253b6a512c222ac642f13df 100644 (file)
@@ -1261,8 +1261,6 @@ struct passwd *getpwuid_alloc(TALLOC_CTX *mem_ctx, uid_t uid) ;
 /* The following definitions come from lib/util_reg.c  */
 
 const char *reg_type_lookup(enum winreg_Type type);
-WERROR reg_pull_multi_sz(TALLOC_CTX *mem_ctx, const void *buf, size_t len,
-                        uint32 *num_values, char ***values);
 bool push_reg_sz(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, const char *s);
 bool push_reg_multi_sz(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, const char **a);
 bool pull_reg_sz(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, const char **s);
index ca46f86f6980105639d4b4a60436089c782c3796..850dbfae663a704436d4c22cb4b0345b49d2c1e3 100644 (file)
@@ -73,29 +73,6 @@ const char *reg_type_lookup(enum winreg_Type type)
        return result;
 }
 
-WERROR reg_pull_multi_sz(TALLOC_CTX *mem_ctx, const void *buf, size_t len,
-                        uint32 *num_values, char ***values)
-{
-       DATA_BLOB blob;
-       const char **vals;
-       int i;
-
-       blob = data_blob_const((uint8_t *)buf, len);
-
-       if (!pull_reg_multi_sz(mem_ctx, &blob, &vals)) {
-               return WERR_NOMEM;
-       }
-
-       for (i=0; vals[i]; i++) {
-               ;;
-       }
-
-       *num_values = i;
-       *values = (char **)vals;
-
-       return WERR_OK;
-}
-
 /*******************************************************************
  push a string in unix charset into a REG_SZ UCS2 null terminated blob
  ********************************************************************/
index 56ecc5472d493a508c7d72598dd8fa4e147fecba..503db774fc0ac2e073d658018f6222e766b2b6e4 100644 (file)
@@ -102,14 +102,27 @@ WERROR registry_pull_value(TALLOC_CTX *mem_ctx,
                SAFE_FREE(tmp);
                break;
        }
-       case REG_MULTI_SZ:
-               err = reg_pull_multi_sz(value, (void *)data, length,
-                                       &value->v.multi_sz.num_strings,
-                                       &value->v.multi_sz.strings);
-               if (!(W_ERROR_IS_OK(err))) {
+       case REG_MULTI_SZ: {
+               int i;
+               const char **vals;
+               DATA_BLOB blob;
+
+               blob = data_blob_const(data, length);
+
+               if (!pull_reg_multi_sz(mem_ctx, &blob, &vals)) {
+                       err = WERR_NOMEM;
                        goto error;
                }
+
+               for (i=0; vals[i]; i++) {
+                       ;;
+               }
+
+               value->v.multi_sz.num_strings = i;
+               value->v.multi_sz.strings = (char **)vals;
+
                break;
+       }
        case REG_BINARY:
                value->v.binary = data_blob_talloc(mem_ctx, data, length);
                break;