: gencache_get (in /usr/local/samba/bin/net)
==25578==by 0x327147: sitename_fetch (in /usr/local/samba/bin/net)
==25578==by 0x3211C9: resolve_name (in /usr/local/samba/bin/net)
==25578==by 0x1EB62D: net_find_server (in /usr/local/samba/bin/net)
==25578==by 0x1EC2C6: net_make_ipc_connection_ex (in
/usr/local/samba/bin/net)
==25578==
--25578--
--25578-- used_suppression: 71 dl-hack3
==25578==
==25578== ERROR SUMMARY: 496 errors from 6 contexts (suppressed: 71 from
10)
El 18/08/11 23:15, Volker Lendecke escribió:
On Thu, Aug 18, 2011 at 02:12:57PM -0700, Jeremy Allison wrote:
On Thu, Aug 18, 2011 at 01:31:36PM +0200, Alejandro Escanero Blanco
wrote:
I'm triing to put some samba3.6 server like print server, the load
of ntprinters and ntdrivers is ok, but when I try to do a backup of
the registry I find it:
#net rpc registry export
'HKLM\System\CurrentControlSet\Control\Print\Environments\Windows NT
x86\Drivers\Version-3\Canon iR2270/iR2870 PCL6' printers.reg
Violación de segmento (Segmentation Fault)
Export fail but enumerate runs correctly. Where is the problem?
There are 2 problems. The first seams there are invalid REG_SZ values within
this registry key, the second net registry export couldn't cope with them.
For the second problem please try the attached patch, the first needs further
investigations.
Gregor
From 913836f0f7495c97ebf7e91044a62c425e1da6f9 Mon Sep 17 00:00:00 2001
From: Gregor Beck gb...@sernet.de
Date: Tue, 6 Sep 2011 09:24:10 +0200
Subject: [PATCH] s3:registry: reg_format: handle unterminated REG_SZ blobs
---
source3/registry/reg_format.c | 10 +-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/source3/registry/reg_format.c b/source3/registry/reg_format.c
index 266629a..315db47 100644
--- a/source3/registry/reg_format.c
+++ b/source3/registry/reg_format.c
@@ -339,6 +339,12 @@ done:
return ret;
}
+static bool is_zero_terminated_ucs2(const uint8_t* data, size_t len) {
+ const size_t idx = len/sizeof(smb_ucs2_t);
+ const smb_ucs2_t *str = (const smb_ucs2_t*)data;
+ return (idx 0) (str[idx] == 0);
+}
+
int reg_format_value(struct reg_format* f, const char* name, uint32_t type,
const uint8_t* data, size_t len)
{
@@ -347,7 +353,9 @@ int reg_format_value(struct reg_format* f, const char* name, uint32_t type,
switch (type) {
case REG_SZ:
- if (!(f-hex_fmt REG_FMT_HEX_SZ)) {
+ if (!(f-hex_fmt REG_FMT_HEX_SZ)
+ is_zero_terminated_ucs2(data, len))
+ {
char* str = NULL;
size_t dlen;
if (pull_ucs2_talloc(mem_ctx, str, (const smb_ucs2_t*)data, dlen)) {
--
1.7.6
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba