librpc/ndr_nbt: we need to keep a trailing '.' in the last component of an nbt_string
authorStefan Metzmacher <metze@samba.org>
Wed, 25 Mar 2015 15:04:06 +0000 (15:04 +0000)
committerGünther Deschner <gd@samba.org>
Fri, 27 Mar 2015 00:26:15 +0000 (01:26 +0100)
Windows uses a username of 'domain.example.com.' as username and we need to
return it that way in the NETLOGON_SAM_LOGON_RESPONSE_EX reply.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
librpc/ndr/ndr_nbt.c

index 842e9720c32f0753b71737d74c477cf810a495c3..ada1335b57d7de89df46c0c76286b1418252bb1f 100644 (file)
@@ -179,6 +179,10 @@ _PUBLIC_ enum ndr_err_code ndr_push_nbt_string(struct ndr_push *ndr, int ndr_fla
                                              (unsigned)complen, (unsigned)complen);
                }
 
+               if (s[complen] == '.' && s[complen+1] == '\0') {
+                       complen++;
+               }
+
                compname = talloc_asprintf(ndr, "%c%*.*s",
                                                (unsigned char)complen,
                                                (unsigned char)complen,