mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-21 01:13:38 +00:00
Check setuid() return value. Bugzilla #7116.
This commit is contained in:
parent
4365d16c86
commit
2b58685402
4 changed files with 26 additions and 10 deletions
|
|
@ -1896,7 +1896,11 @@ xf86RunVtInit(void)
|
|||
FatalError("xf86RunVtInit: fork failed (%s)\n", strerror(errno));
|
||||
break;
|
||||
case 0: /* child */
|
||||
setuid(getuid());
|
||||
if (setuid(getuid()) == -1) {
|
||||
xf86Msg(X_ERROR, "xf86RunVtInit: setuid failed (%s)\n",
|
||||
strerror(errno));
|
||||
exit(255);
|
||||
}
|
||||
/* set stdin, stdout to the consoleFd */
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (xf86Info.consoleFd != i) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue