summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu.herrb@laas.fr>2006-06-20 19:25:51 +0000
committerMatthieu Herrb <matthieu.herrb@laas.fr>2006-06-20 19:25:51 +0000
commit4fc9d215202b494a9182913f84eb41ba2bd1e39b (patch)
tree59547745b3ce734b2661c9232ba4d4802794eb9a
parent732e5f17cf5189854654360e978a62d6d6b82d4b (diff)
Check setuid() return value. Bugzilla #7116.
-rw-r--r--ChangeLog5
-rw-r--r--xinit.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 94740ca..af1440c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-06-20 Matthieu Herrb <matthieu.herrb@laas.fr>
+
+ * xinit.c:
+ Check setuid() return value. Bugzilla #7116.
+
2006-05-27 Jeremy C. Reed <reed@reedmedia.net>
* startx.cpp:
diff --git a/xinit.c b/xinit.c
index 956d78a..818f754 100644
--- a/xinit.c
+++ b/xinit.c
@@ -692,7 +692,10 @@ static int
startClient(char *client[])
{
if ((clientpid = vfork()) == 0) {
- setuid(getuid());
+ if (setuid(getuid()) == -1) {
+ Error("cannot change uid: %s\n", strerror(errno));
+ _exit(ERR_EXIT);
+ }
setpgrp(0, getpid());
environ = newenviron;
#ifdef __UNIXOS2__