From: Jeremy Allison Date: Fri, 28 Jan 2005 21:55:45 +0000 (+0000) Subject: r5066: A couple of small fixes from James Peach @ SGI. X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~5335 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9d131e94195df79e07c8fad20e12ba1b67441a81;p=thirdparty%2Fsamba.git r5066: A couple of small fixes from James Peach @ SGI. Jeremy. --- diff --git a/source/lib/util.c b/source/lib/util.c index 455f87aaab8..d910dff5477 100644 --- a/source/lib/util.c +++ b/source/lib/util.c @@ -1534,6 +1534,11 @@ void smb_panic2(const char *why, BOOL decrement_pid_count ) ZERO_ARRAY(names); ZERO_ARRAY(namebuf); + /* We need to be root so we can open our /proc entry to walk + * our stack. It also helps when we want to dump core. + */ + become_root(); + for (i = 0; i < BACKTRACE_STACK_SIZE; i++) { names[i] = namebuf + (i * NAMESIZE); } diff --git a/source/lib/util_str.c b/source/lib/util_str.c index 6b6581b4a7b..394c8e27cff 100644 --- a/source/lib/util_str.c +++ b/source/lib/util_str.c @@ -1558,8 +1558,8 @@ int fstr_sprintf(fstring s, const char *fmt, ...) size_t strnlen(const char *s, size_t n) { - int i; - for (i=0; s[i] && i