The Samba-Bugzilla – Bug 934
Default vsnprintf on solaris 8 (with cc) is broken
Last modified: 2005-08-24 10:19:46 UTC
The default vsnprintf in solaris 8 (when using the default compiler) is broken
(in that when you pass in NULL as the destination is automatically returns 0).
This causes lp_string to fail and random segfaults to occur (in winbind
particularly. The solution I used (to try and get) was to modify vasprintf to
call dopr directly (since the cc linker seems to always default to the standard
one). Once this is done, everything seems to work perfectly.
*** source/lib/snprintf.c~ Fri Nov 7 09:37:35 2003
--- source/lib/snprintf.c Mon Feb 9 20:34:24 2004
*** 852,858 ****
--- 852,862 ----
+ #ifdef SUNOS5
+ ret = dopr(NULL, 0, format, ap2);
ret = vsnprintf(NULL, 0, format, ap2);
if (ret <= 0) return ret;
(*ptr) = (char *)malloc(ret+1);
Created attachment 587 [details]
use builtin vsnprintf consistently
I believe this problem is present in any
system that doesn't do unix98 snprintf by default. This
includes IRIX and (I guess) Solaris.
I think you need to also need to change the "vsnprintf" function on line
snprintf.c:824 to "smb_vsnprintf" for the given patch to work.
You also need to modify talloc.c to replace vsnprintf with smb_vsnprintf;
otherwise, talloc_asnprintf fails miserably.
James, did your patch get applied. Can we close this one ?
fixed in 3.0.6 according to the release notes.
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.