Attempt to fix the patchfile_preg backend for big endian machines.
authorWilco Baan Hofman <wilco@synlap.(none)>
Mon, 14 Apr 2008 10:48:25 +0000 (12:48 +0200)
committerWilco Baan Hofman <wilco@synlap.(none)>
Mon, 14 Apr 2008 10:48:25 +0000 (12:48 +0200)
Update some functions to properly state what is not supported (yet).
Registry .reg uses UCS-2, not UTF-16.
(This used to be commit 664a035dd9fc6e3b50a771baa98f8d79360cc4c1)

source4/lib/registry/patchfile_dotreg.c
source4/lib/registry/patchfile_preg.c

index 59f40447135a9b332e1fdc1cb12fac7767a30624..5aa7e2bab71a9e4b8c705676beab2f632e8b1d91 100644 (file)
@@ -20,7 +20,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-/* FIXME Newer .REG files, created by Windows XP and above use unicode UTF-16 */
+/* FIXME Newer .REG files, created by Windows XP and above use unicode UCS-2 */
 
 #include "includes.h"
 #include "lib/registry/registry.h"
index 0fa367bfcb7ee8a915b9316ff8877b351dac3e0c..5216a04c8b63fd0896a47127c1cd598d18a9e606 100644 (file)
@@ -42,30 +42,30 @@ static WERROR preg_read_utf16(struct smb_iconv_convenience *ic, int fd, char *c)
 /* FIXME These functions need to be implemented */
 static WERROR reg_preg_diff_add_key(void *_data, const char *key_name)
 {
-       return WERR_OK;
+       return WERR_NOT_SUPPORTED;
 }
 
 static WERROR reg_preg_diff_del_key(void *_data, const char *key_name)
 {
-       return WERR_OK;
+       return WERR_NOT_SUPPORTED;
 }
 
 static WERROR reg_preg_diff_set_value(void *_data, const char *key_name,
                                      const char *value_name,
                                      uint32_t value_type, DATA_BLOB value_data)
 {
-       return WERR_OK;
+       return WERR_NOT_SUPPORTED;
 }
 
 static WERROR reg_preg_diff_del_value(void *_data, const char *key_name,
                                      const char *value_name)
 {
-       return WERR_OK;
+       return WERR_NOT_SUPPORTED;
 }
 
 static WERROR reg_preg_diff_del_all_values(void *_data, const char *key_name)
 {
-       return WERR_OK;
+       return WERR_NOT_SUPPORTED;
 }
 
 static WERROR reg_preg_diff_done(void *_data)
@@ -149,6 +149,8 @@ _PUBLIC_ WERROR reg_preg_diff_load(int fd,
                ret = WERR_GENERAL_FAILURE;
                goto cleanup;
        }
+       preg_header.version = IVAL(&preg_header.version, 0);
+
        if (strncmp(preg_header.hdr, "PReg", 4) != 0) {
                DEBUG(0, ("This file is not a valid preg registry file\n"));
                ret = WERR_GENERAL_FAILURE;
@@ -193,6 +195,8 @@ _PUBLIC_ WERROR reg_preg_diff_load(int fd,
                        ret = WERR_GENERAL_FAILURE;
                        goto cleanup;
                }
+               value_type = IVAL(&value_type, 0);
+
                /* Read past delimiter */
                buf_ptr = buf;
                if (!(W_ERROR_IS_OK(preg_read_utf16(iconv_convenience, fd, buf_ptr)) &&