From: Wolfgang Stöggl Date: Sat, 9 Feb 2019 23:27:47 +0000 (+0100) Subject: Call getuid() only if HAVE_GETUID is defined X-Git-Tag: v1.7.2~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1b6bb614c0676b750985aa8cb744bb34a5aa4f9;p=thirdparty%2Frrdtool-1.x.git Call getuid() only if HAVE_GETUID is defined --- diff --git a/src/rrd_tool.c b/src/rrd_tool.c index 4a01760d..7a2fb7ba 100644 --- a/src/rrd_tool.c +++ b/src/rrd_tool.c @@ -582,7 +582,7 @@ static int HandleInputLine( printf("ERROR: invalid parameter count for cd\n"); return (1); } -#if ! defined(HAVE_CHROOT) || ! defined(HAVE_GETUID) +#if ! defined(HAVE_CHROOT) && defined(HAVE_GETUID) if (getuid() == 0 && !ChangeRoot) { printf ("ERROR: chdir security problem - rrdtool is running as " @@ -622,7 +622,7 @@ static int HandleInputLine( printf("ERROR: invalid parameter count for mkdir\n"); return (1); } -#if ! defined(HAVE_CHROOT) || ! defined(HAVE_GETUID) +#if ! defined(HAVE_CHROOT) && defined(HAVE_GETUID) if (getuid() == 0 && !ChangeRoot) { printf ("ERROR: mkdir security problem - rrdtool is running as "