diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-11-19 17:07:59 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:15:55 -0500 |
commit | 016ddce12005bb0829bf050e4d4851852751b3e5 (patch) | |
tree | 69f689bb6d73eeb2df17106c1a997eea5ab16b26 /source | |
parent | f808182346aa16bb2f3a9383e28d318099a5e14e (diff) | |
download | samba-016ddce12005bb0829bf050e4d4851852751b3e5.tar.gz samba-016ddce12005bb0829bf050e4d4851852751b3e5.tar.xz samba-016ddce12005bb0829bf050e4d4851852751b3e5.zip |
r19786: 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
Diffstat (limited to 'source')
-rw-r--r-- | source/lib/util_str.c | 18 | ||||
-rw-r--r-- | source/librpc/idl/winreg.idl | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/source/lib/util_str.c b/source/lib/util_str.c index 414a87a562c..fc13b75cc57 100644 --- a/source/lib/util_str.c +++ b/source/lib/util_str.c @@ -1644,6 +1644,24 @@ size_t strlen_m_term(const char *s) 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. diff --git a/source/librpc/idl/winreg.idl b/source/librpc/idl/winreg.idl index e911f475250..a69079bf8e5 100644 --- a/source/librpc/idl/winreg.idl +++ b/source/librpc/idl/winreg.idl @@ -132,7 +132,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl"; ); 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 */ |