compositor: check if seteuid worked
Checking the return value from seteuid in order to not launch clients with the wrong effective uid. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
This commit is contained in:
committed by
Kristian Høgsberg
parent
c3ea26c02d
commit
840a421a5e
+5
-2
@@ -247,8 +247,11 @@ child_client_exec(int sockfd, const char *path)
|
|||||||
sigfillset(&allsigs);
|
sigfillset(&allsigs);
|
||||||
sigprocmask(SIG_UNBLOCK, &allsigs, NULL);
|
sigprocmask(SIG_UNBLOCK, &allsigs, NULL);
|
||||||
|
|
||||||
/* Launch clients as the user. */
|
/* Launch clients as the user. Do not lauch clients with wrong euid.*/
|
||||||
seteuid(getuid());
|
if (seteuid(getuid()) == -1) {
|
||||||
|
weston_log("compositor: failed seteuid\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* SOCK_CLOEXEC closes both ends, so we dup the fd to get a
|
/* SOCK_CLOEXEC closes both ends, so we dup the fd to get a
|
||||||
* non-CLOEXEC fd to pass through exec. */
|
* non-CLOEXEC fd to pass through exec. */
|
||||||
|
|||||||
Reference in New Issue
Block a user