Bug #6213: Check geteuid's return value, not its address, otherwise

unprivileged users can set the modulepath and run arbitrary code. Patch
    from Matthieu Herrb. (CVE-2006-0745, Coverity #4)
This commit is contained in:
Adam Jackson 2006-03-20 14:01:05 +00:00
parent 8c1bb37d06
commit 6eb4e2303a
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2006-03-20 Adam Jackson <ajax@freedesktop.org>
* hw/xfree86/common/xf86Init.c:
Bug #6213: Check geteuid's return value, not its address, otherwise
unprivileged users can set the modulepath and run arbitrary code.
Patch from Matthieu Herrb. (CVE-2006-0745, Coverity #4)
2006-03-16 Kristian Høgsberg <krh@redhat.com>
* configure.ac: Check for glproto when building GLX and make sure

View File

@ -1,5 +1,5 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.212 2004/01/27 01:31:45 dawes Exp $ */
/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Init.c,v 1.30 2006/02/13 04:43:40 benh Exp $ */
/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Init.c,v 1.31 2006/03/07 23:58:22 idr Exp $ */
/*
* Loosely based on code bearing the following copyright:
@ -1377,7 +1377,7 @@ ddxProcessArgument(int argc, char **argv, int i)
}
/* First the options that are only allowed for root */
if (getuid() == 0 || geteuid != 0)
if (getuid() == 0 || geteuid() != 0)
{
if (!strcmp(argv[i], "-modulepath"))
{
@ -1677,7 +1677,7 @@ ddxProcessArgument(int argc, char **argv, int i)
}
if (!strcmp(argv[i], "-configure"))
{
if (getuid() != 0 && geteuid == 0) {
if (getuid() != 0 && geteuid() == 0) {
ErrorF("The '-configure' option can only be used by root.\n");
exit(1);
}