]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
rrdtool: fix mis-use of getuid
authorPeter A. Bigot <pab@pabigot.com>
Sat, 31 May 2014 22:44:05 +0000 (17:44 -0500)
committerPeter A. Bigot <pab@pabigot.com>
Sun, 1 Jun 2014 00:25:10 +0000 (19:25 -0500)
Checking whether the application is running with root privileges requires
use of geteuid(), not getuid().

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
src/rrd_tool.c

index a9543744ab2f0a3b888891a15bd7a4822dd24c45..018e4c547d4d156db5d8a19597d5cd0c5dd51ef3 100644 (file)
@@ -447,8 +447,8 @@ int main(
         if ((argc == 3) && strcmp("", argv[2])) {
 
             if (
-#ifdef HAVE_GETUID
-                   getuid()
+#ifdef HAVE_GETEUID
+                   geteuid()
 #else
                    1
 #endif