diff options
author | Alan Coopersmith <alanc@alf.(none)> | 2006-06-20 15:29:55 -0700 |
---|---|---|
committer | Alan Coopersmith <alanc@alf.(none)> | 2006-06-20 15:29:55 -0700 |
commit | 88ede2cec79281a43cecb43ee6dec65770f82530 (patch) | |
tree | 8abace811be1d9399f5c286aada166bae0d57283 /os | |
parent | 227a3193405147fbbee2971cc15bac92cc13285a (diff) | |
parent | 2b58685402e70f123e131fd8146e6083ff5214a4 (diff) |
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver
Diffstat (limited to 'os')
-rw-r--r-- | os/utils.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/os/utils.c b/os/utils.c index 43c6365a4..617d20119 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xserver/xorg/os/utils.c,v 1.25 2006/03/25 19:52:05 ajax Exp $ */ +/* $XdotOrg: xserver/xorg/os/utils.c,v 1.26 2006-06-01 22:06:41 daniels Exp $ */ /* $Xorg: utils.c,v 1.5 2001/02/09 02:05:24 xorgcvs Exp $ */ /* @@ -1713,8 +1713,10 @@ System(char *command) case -1: /* error */ p = -1; case 0: /* child */ - setgid(getgid()); - setuid(getuid()); + if (setgid(getgid()) == -1) + _exit(127); + if (setuid(getuid()) == -1) + _exit(127); execl("/bin/sh", "sh", "-c", command, (char *)NULL); _exit(127); default: /* parent */ @@ -1765,8 +1767,10 @@ Popen(char *command, char *type) xfree(cur); return NULL; case 0: /* child */ - setgid(getgid()); - setuid(getuid()); + if (setgid(getgid()) == -1) + _exit(127); + if (setuid(getuid()) == -1) + _exit(127); if (*type == 'r') { if (pdes[1] != 1) { /* stdout */ @@ -1840,8 +1844,10 @@ Fopen(char *file, char *type) xfree(cur); return NULL; case 0: /* child */ - setgid(getgid()); - setuid(getuid()); + if (setgid(getgid()) == -1) + _exit(127); + if (setuid(getuid()) == -1) + _exit(127); if (*type == 'r') { if (pdes[1] != 1) { /* stdout */ |