[PATCH 2/4] backlight: Use System instead of system when checking for pkexec

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Event though we've failed to open the backlight normally, we may still be
running under a suid-root xserver, so use the servers build in System instead
of system so as to properly drop root rights.

Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
---
 src/backlight.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/backlight.c b/src/backlight.c
index 0e63ba5..518d756 100644
--- a/src/backlight.c
+++ b/src/backlight.c
@@ -41,6 +41,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <dirent.h>
+#include <xf86.h>
 
 #include "backlight.h"
 #include "fd.h"
@@ -283,7 +284,7 @@ static int __backlight_helper_init(struct backlight *b, char *iface)
 		return 0;
 
 	if ((st.st_mode & (S_IFREG | S_ISUID | S_IXUSR)) != (S_IFREG | S_ISUID | S_IXUSR)) {
-		if (system("pkexec --version"))
+		if (System("pkexec --version"))
 			return 0;
 
 		use_pkexec = 1;
-- 
1.8.5.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux