summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2013-09-25 14:47:47 +0100
committerKristian Høgsberg <krh@bitplanet.net>2013-09-26 16:18:11 -0700
commit840a421a5e4525898eb51ea9e1a908bfb4212d92 (patch)
tree234068210f413b53e563510bed00975ef87d21be
parentc3ea26c02d953e5d5c4046d03edd297d69a0797b (diff)
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>
-rw-r--r--src/compositor.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compositor.c b/src/compositor.c
index f619f827..a2c87259 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -247,8 +247,11 @@ child_client_exec(int sockfd, const char *path)
sigfillset(&allsigs);
sigprocmask(SIG_UNBLOCK, &allsigs, NULL);
- /* Launch clients as the user. */
- seteuid(getuid());
+ /* Launch clients as the user. Do not lauch clients with wrong euid.*/
+ if (seteuid(getuid()) == -1) {
+ weston_log("compositor: failed seteuid\n");
+ return;
+ }
/* SOCK_CLOEXEC closes both ends, so we dup the fd to get a
* non-CLOEXEC fd to pass through exec. */