svn commit: samba r10351 - in branches/tmp/samba4-winsrepl/source/wrepl_server: .

metze at samba.org metze at samba.org
Tue Sep 20 14:11:18 GMT 2005


Author: metze
Date: 2005-09-20 14:11:17 +0000 (Tue, 20 Sep 2005)
New Revision: 10351

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

Log:
fix namebuf_len, when type is 0x00

metze
Modified:
   branches/tmp/samba4-winsrepl/source/wrepl_server/wrepl_in_call.c


Changeset:
Modified: branches/tmp/samba4-winsrepl/source/wrepl_server/wrepl_in_call.c
===================================================================
--- branches/tmp/samba4-winsrepl/source/wrepl_server/wrepl_in_call.c	2005-09-20 13:42:08 UTC (rev 10350)
+++ branches/tmp/samba4-winsrepl/source/wrepl_server/wrepl_in_call.c	2005-09-20 14:11:17 UTC (rev 10351)
@@ -169,13 +169,19 @@
 	}
 
 	namebuf = (uint8_t *)talloc_asprintf(mem_ctx, "%-15s%c%s",
-					    rec->name->name, rec->name->type,
+					    rec->name->name, 'X',
 					    (rec->name->scope?rec->name->scope:""));
 	NT_STATUS_HAVE_NO_MEMORY(namebuf);
 	namebuf_len = strlen((char *)namebuf) + 1;
 
+	/*
+	 * we need to set the type here, and use a place-holder in the talloc_asprintf()
+	 * as the type can be 0x00, and then the namebuf_len = strlen(namebuf); would give wrong results
+	 */
+	namebuf[15] = rec->name->type;
+
 	/* oh wow, what a nasty bug in windows ... */
-	if (namebuf[15] == 0x1b && namebuf_len >= 16) {
+	if (rec->name->type == 0x1b) {
 		namebuf[15] = namebuf[0];
 		namebuf[0] = 0x1b;
 	}



More information about the samba-cvs mailing list