svn commit: samba r17846 - in
branches/SAMBA_4_0/source/libcli/security: .
vlendec at samba.org
vlendec at samba.org
Sat Aug 26 22:27:30 GMT 2006
Author: vlendec
Date: 2006-08-26 22:27:29 +0000 (Sat, 26 Aug 2006)
New Revision: 17846
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17846
Log:
Ok, this is a patch that needs further discussion. On Solaris, snprintf seems
to be broken. The %lu modifies apparently can not cope with the high
bit==1. In dom_sid_string I added some printfs and got:
auth: 21
auth: 2666793276
auth: 679821296
auth: 2310223117
auth: 1206
sid=S-1-5-21-8446744072081377596-679821296-8446744071724807437-1206
The "auth:" values are direct printfs, the sid= is the resulting code from
dom_sid_string.
I could not reproduce it with a simple test program, and #ifdef'ing out
HAVE_SNPRINTF in config.h manually does not help either, probably because the
dynamic linker overwrites the symbol in lib/replace.
Checking it in because it fixes the RPC-SAMBA3-SHARESEC test directly on host
"sunx", I would like to see whether it also fixes IRIX and AIX.
Volker
Modified:
branches/SAMBA_4_0/source/libcli/security/dom_sid.c
Changeset:
Modified: branches/SAMBA_4_0/source/libcli/security/dom_sid.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/security/dom_sid.c 2006-08-26 20:56:49 UTC (rev 17845)
+++ branches/SAMBA_4_0/source/libcli/security/dom_sid.c 2006-08-26 22:27:29 UTC (rev 17846)
@@ -285,7 +285,14 @@
(unsigned int)sid->sid_rev_num, (unsigned long)ia);
for (i = 0; i < sid->num_auths; i++) {
- ofs += snprintf(ret + ofs, maxlen - ofs, "-%lu", (unsigned long)sid->sub_auths[i]);
+ char *tmp = talloc_asprintf(mem_ctx, "%lu",
+ (unsigned long)sid->sub_auths[i]);
+ if (tmp == NULL) {
+ talloc_free(ret);
+ return NULL;
+ }
+ ofs += snprintf(ret + ofs, maxlen - ofs, "-%s", tmp);
+ talloc_free(tmp);
}
return ret;
More information about the samba-cvs
mailing list