summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilco Baan Hofman <wilco@synlap.(none)>2008-04-14 12:48:25 +0200
committerWilco Baan Hofman <wilco@synlap.(none)>2008-04-14 12:48:25 +0200
commit212644b5a1107ad81e5ce3bc3118c8983d3f2a86 (patch)
treec50c73288481e92b074161a0434d86baecfb821d
parent2bb20aa8a8ff1170fd4d2a349a421990b0d7c235 (diff)
downloadsamba-212644b5a1107ad81e5ce3bc3118c8983d3f2a86.tar.gz
samba-212644b5a1107ad81e5ce3bc3118c8983d3f2a86.tar.bz2
samba-212644b5a1107ad81e5ce3bc3118c8983d3f2a86.zip
Attempt to fix the patchfile_preg backend for big endian machines.
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)
-rw-r--r--source4/lib/registry/patchfile_dotreg.c2
-rw-r--r--source4/lib/registry/patchfile_preg.c14
2 files changed, 10 insertions, 6 deletions
diff --git a/source4/lib/registry/patchfile_dotreg.c b/source4/lib/registry/patchfile_dotreg.c
index 59f4044713..5aa7e2bab7 100644
--- a/source4/lib/registry/patchfile_dotreg.c
+++ b/source4/lib/registry/patchfile_dotreg.c
@@ -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"
diff --git a/source4/lib/registry/patchfile_preg.c b/source4/lib/registry/patchfile_preg.c
index 0fa367bfcb..5216a04c8b 100644
--- a/source4/lib/registry/patchfile_preg.c
+++ b/source4/lib/registry/patchfile_preg.c
@@ -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)) &&