backlight: use system() instead of System()

The Xserver's System() function is a special wrapper for calling a program
(xkbcomp) as an unprivileged user, when the Xserver is running as suid-root.
(which today only needed on a few platforms, eg. Solaris). Therefore it's
not suited for being called by arbitrary drivers.

In this specific context it doesn't even much sense, since it's just used
for checking whether pkexec command is present at all (and just should be
used), while the actual exec'ing of the helper is done directly by fork()
and exec() syscalls.

Thus we can safely use standard system() call instead - clearing the road
for dropping System() from Xserver's public/driver API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2024-02-20 21:20:09 +01:00
parent 08876d7024
commit 3f9e8b20da

View File

@@ -366,7 +366,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;