]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Call getuid() only if HAVE_GETUID is defined
authorWolfgang Stöggl <c72578@yahoo.de>
Sat, 9 Feb 2019 23:27:47 +0000 (00:27 +0100)
committerTobias Oetiker <tobi@oetiker.ch>
Sun, 10 Feb 2019 11:16:30 +0000 (12:16 +0100)
src/rrd_tool.c

index 4a01760dada12da8525df99f3b85b22d09b719f4..7a2fb7bafb4ae6c291438176633c858212a8404e 100644 (file)
@@ -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 "