svn commit: samba r19786 - in branches/SAMBA_3_0/source: lib librpc/idl

vlendec at samba.org vlendec at samba.org
Sun Nov 19 17:07:59 GMT 2006


Author: vlendec
Date: 2006-11-19 17:07:59 +0000 (Sun, 19 Nov 2006)
New Revision: 19786

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19786

Log:
My last checkin to winreg_StringBuf killed rpccli_winreg_EnumKeys against
W2k3. The server requires that size==0 in the [in] name. Somehow I get the
feeling that something is badly wrong here....

I did not yet recreate the gen_ndr equivalent, see next mail.

Volker

Modified:
   branches/SAMBA_3_0/source/lib/util_str.c
   branches/SAMBA_3_0/source/librpc/idl/winreg.idl


Changeset:
Modified: branches/SAMBA_3_0/source/lib/util_str.c
===================================================================
--- branches/SAMBA_3_0/source/lib/util_str.c	2006-11-19 17:06:20 UTC (rev 19785)
+++ branches/SAMBA_3_0/source/lib/util_str.c	2006-11-19 17:07:59 UTC (rev 19786)
@@ -1644,6 +1644,24 @@
 	return strlen_m(s) + 1;
 }
 
+/*
+ * Weird helper routine for the winreg pipe: If nothing is around, return 0,
+ * if a string is there, include the terminator.
+ */
+
+size_t strlen_m_term_null(const char *s)
+{
+	size_t len;
+	if (!s) {
+		return 0;
+	}
+	len = strlen_m(s);
+	if (len == 0) {
+		return 0;
+	}
+
+	return len+1;
+}
 /**
  Return a RFC2254 binary string representation of a buffer.
  Used in LDAP filters.

Modified: branches/SAMBA_3_0/source/librpc/idl/winreg.idl
===================================================================
--- branches/SAMBA_3_0/source/librpc/idl/winreg.idl	2006-11-19 17:06:20 UTC (rev 19785)
+++ branches/SAMBA_3_0/source/librpc/idl/winreg.idl	2006-11-19 17:07:59 UTC (rev 19786)
@@ -132,7 +132,7 @@
 	);
 
 	typedef struct {
-		[value(strlen_m_term(name)*2)] uint16 length; 
+		[value(strlen_m_term_null(name)*2)] uint16 length; 
 		/* size cannot be auto-set by value() as it is the
 		   amount of space the server is allowed to use for this
 		   string in the reply, not its current size */



More information about the samba-cvs mailing list