summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-08-26 22:27:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:48 -0500
commit9ba16109e50ca9e411c62dbdfd7a0ed44591d2be (patch)
tree10f92c8e7b16d485ecf390a62647e225fb9f5d1e /source4
parent03dd0d5fc84abafea48dd103da4c6ade23ad05b7 (diff)
downloadsamba-9ba16109e50ca9e411c62dbdfd7a0ed44591d2be.tar.gz
samba-9ba16109e50ca9e411c62dbdfd7a0ed44591d2be.tar.bz2
samba-9ba16109e50ca9e411c62dbdfd7a0ed44591d2be.zip
r17846: 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 (This used to be commit 1a9401738f652a87d377a32086342f5f98525fc2)
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/security/dom_sid.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source4/libcli/security/dom_sid.c b/source4/libcli/security/dom_sid.c
index 54242eb515..90421104a7 100644
--- a/source4/libcli/security/dom_sid.c
+++ b/source4/libcli/security/dom_sid.c
@@ -285,7 +285,14 @@ char *dom_sid_string(TALLOC_CTX *mem_ctx, const struct dom_sid *sid)
(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;