s3-registry: remove 2 byte winreg type limitation.
authorGünther Deschner <gd@samba.org>
Thu, 1 Jul 2010 09:22:20 +0000 (11:22 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 2 Jul 2010 08:50:22 +0000 (10:50 +0200)
We already pull and push 4 byte winreg type in the registry.tdb, we were just
not using full 4 bytes within the reg_object functions.

With this change we finally pass the set extended value torture test.

Guenther

source3/registry/reg_objects.c
source3/registry/reg_objects.h

index 459f7fca7022e01282defa8bebe3c45bdfa20df7..04b981015e5b3553ea949cfa0e2fe76d64c59650 100644 (file)
@@ -31,7 +31,7 @@
 
 struct regval_blob {
        fstring         valuename;
-       uint16_t        type;
+       uint32_t        type;
        /* this should be encapsulated in an RPC_DATA_BLOB */
        uint32_t        size;   /* in bytes */
        uint8_t         *data_p;
@@ -460,7 +460,7 @@ bool regval_ctr_key_exists(struct regval_ctr *ctr, const char *value)
  **********************************************************************/
 
 struct regval_blob *regval_compose(TALLOC_CTX *ctx, const char *name,
-                                  uint16_t type,
+                                  uint32_t type,
                                   const uint8_t *data_p, size_t size)
 {
        struct regval_blob *regval = TALLOC_P(ctx, struct regval_blob);
@@ -489,7 +489,7 @@ struct regval_blob *regval_compose(TALLOC_CTX *ctx, const char *name,
  Add a new registry value to the array
  **********************************************************************/
 
-int regval_ctr_addvalue(struct regval_ctr *ctr, const char *name, uint16_t type,
+int regval_ctr_addvalue(struct regval_ctr *ctr, const char *name, uint32_t type,
                         const uint8_t *data_p, size_t size)
 {
        if ( !name )
index 737a2d5021e0f01a8471e8238ea6d47010088096..a84bc8a80bcb4ae596595673f191c2656d3e5719 100644 (file)
@@ -57,9 +57,9 @@ struct regval_blob* regval_ctr_specific_value(struct regval_ctr *ctr,
                                              uint32_t idx);
 bool regval_ctr_key_exists(struct regval_ctr *ctr, const char *value);
 struct regval_blob *regval_compose(TALLOC_CTX *ctx, const char *name,
-                                  uint16_t type,
+                                  uint32_t type,
                                   const uint8_t *data_p, size_t size);
-int regval_ctr_addvalue(struct regval_ctr *ctr, const char *name, uint16_t type,
+int regval_ctr_addvalue(struct regval_ctr *ctr, const char *name, uint32_t type,
                        const uint8_t *data_p, size_t size);
 int regval_ctr_addvalue_sz(struct regval_ctr *ctr, const char *name, const char *data);
 int regval_ctr_addvalue_multi_sz(struct regval_ctr *ctr, const char *name, const char **data);