diff options
author | lesi <lesi@FreeBSD.org> | 2005-06-21 02:30:39 +0800 |
---|---|---|
committer | lesi <lesi@FreeBSD.org> | 2005-06-21 02:30:39 +0800 |
commit | 2bee9c884900b89c46513bf8dc21c5cb5c321828 (patch) | |
tree | 07e2ae3e54b1c6856e8e758a8e489d6589baa52d /x11-servers | |
parent | 24760aafbc337663ba6612c5f59bd7866030695c (diff) | |
download | freebsd-ports-gnome-2bee9c884900b89c46513bf8dc21c5cb5c321828.tar.gz freebsd-ports-gnome-2bee9c884900b89c46513bf8dc21c5cb5c321828.tar.zst freebsd-ports-gnome-2bee9c884900b89c46513bf8dc21c5cb5c321828.zip |
- Install X server setuid root by default, and provide a switch
NO_SUID_XSERVER to disable this. The end result is same as it was before
with x11/wrapper installed as the code from there is included in X
server. It is also the same as xorg-server port does (from which this
changes were taken). This should conclude removal of dependency on
x11/wrapper from meta port for above reasons. [1]
- (patch-bsdResource.c) Correct the ranges of the bus resource windows on
sparc64. This makes PCI video cards work that hang off directly from
the Host-to-PCI bridge in machines like the Blade 100. [2]
- (patch-HALlib_bindings.c patch-mga_driver.c) Revert the MGA HALlib
MGASetDisplayStart interface back to HALSetDisplayStart (taken from
upstream CVS) [3]
Noticed by: (bugsgrief at bugsgrief.net) [1]
Submitted by: marius [2]
Reported and tested by: Steven Friedrich (FreeBSD at InsightBB.com) [3]
Diffstat (limited to 'x11-servers')
-rw-r--r-- | x11-servers/XFree86-4-Server/Makefile | 22 | ||||
-rw-r--r-- | x11-servers/XFree86-4-Server/files/patch-HALlib_bindings.c | 27 | ||||
-rw-r--r-- | x11-servers/XFree86-4-Server/files/patch-bsdResource.c | 68 | ||||
-rw-r--r-- | x11-servers/XFree86-4-Server/files/patch-mga_driver.c | 35 | ||||
-rw-r--r-- | x11-servers/XFree86-4-Server/pkg-message | 5 | ||||
-rw-r--r-- | x11-servers/XFree86-4-Server/scripts/configure | 1 |
6 files changed, 144 insertions, 14 deletions
diff --git a/x11-servers/XFree86-4-Server/Makefile b/x11-servers/XFree86-4-Server/Makefile index e9f1b2d4a7ea..866affd0da5c 100644 --- a/x11-servers/XFree86-4-Server/Makefile +++ b/x11-servers/XFree86-4-Server/Makefile @@ -7,6 +7,7 @@ PORTNAME= Server PORTVERSION= 4.5.0 +PORTREVISION= 1 CATEGORIES= x11-servers MASTER_SITES= ${MASTER_SITE_XFREE} MASTER_SITE_SUBDIR= ${PORTVERSION} @@ -90,7 +91,6 @@ MAN4= citron.4x \ wacom.4x MAN5= XF86Config.5 \ getconfig.5 -PKGMESSAGE= ${WRKDIR}/.pkg-message XBUILD_DIRS= lib/font lib/lbxutil lib/Xdmcp lib/Xau programs/Xserver XINCLUDE_DIRS= lib/xkbfile lib/xtrans XINSTALL_DIRS= lib/font programs/Xserver @@ -200,14 +200,18 @@ MAN4+= rendition.4x \ siliconmotion.4x .endif -post-build: - @${RM} -f ${PKGMESSAGE} - @${CAT} ${.CURDIR}/pkg-message >> ${PKGMESSAGE} +.if !defined(NO_SUID_XSERVER) || ${NO_SUID_XSERVER} == NO +pre-everything:: + @${ECHO_MSG} "By default, the X Server installs as a set-user-id root binary. When run by" + @${ECHO_MSG} "a normal user, it checks arguments and environment as done in the x11/wrapper" + @${ECHO_MSG} "port before handling them normally. If you are concerned about the security" + @${ECHO_MSG} "of this, but still want to run an X Server (for example using xdm/kdm/gdm," + @${ECHO_MSG} "which will still run the server as root), you can cancel the build and set" + @${ECHO_MSG} "NO_SUID_XSERVER=YES in /etc/make.conf." -post-install:: - @${SED} -e s,/usr/X11R6,${PREFIX}, ${PKGMESSAGE} - @if [ -f ${PREFIX}/bin/Xwrapper-4 ] ; then \ - ${LN} -sf Xwrapper-4 ${PREFIX}/bin/X; \ - fi; +SCRIPTS_ENV+= SUID_XSERVER=YES +.else +SCRIPTS_ENV+= SUID_XSERVER=NO +.endif .include <bsd.port.post.mk> diff --git a/x11-servers/XFree86-4-Server/files/patch-HALlib_bindings.c b/x11-servers/XFree86-4-Server/files/patch-HALlib_bindings.c new file mode 100644 index 000000000000..4f2b4f41f0f6 --- /dev/null +++ b/x11-servers/XFree86-4-Server/files/patch-HALlib_bindings.c @@ -0,0 +1,27 @@ +Index: programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h +=================================================================== +RCS file: /cvs/xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h,v +retrieving revision 1.6 +retrieving revision 1.7 +diff -u -r1.6 -r1.7 +--- programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h 31 Mar 2004 16:37:09 -0000 1.6 ++++ programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h 26 Apr 2005 00:56:44 -0000 1.7 +@@ -210,6 +210,8 @@ + #define MGAMODEINFO_FORCE_PITCH (1L << 5) + #define MGAMODEINFO_FORCE_DISPLAYORG (1L << 6) + #define MGAMODEINFO_TV (1L << 7) ++#define MGAMODEINFO_FLATPANEL1 (1L << 8) ++#define MGAMODEINFO_FLATPANEL2 (1L << 9) + #define MGAMODEINFO_TESTONLY 0x80000000 + + /* Cable Type */ +@@ -243,7 +245,8 @@ + ULONG MGAGetBOARDHANDLESize(void); + ULONG MGASetTVStandard(LPBOARDHANDLE pBoard, ULONG ulTVStandard); + ULONG MGASetTVCableType(LPBOARDHANDLE pBoard, ULONG ulCableType); +-ULONG MGASetDisplayStart(LPBOARDHANDLE pBoard, ULONG ulX, ULONG ulY, ULONG ulCrtc); ++ULONG MGAForceFlatPanel(LPBOARDHANDLE pBoard); ++ULONG HALSetDisplayStart(LPBOARDHANDLE pBoard, ULONG ulX, ULONG ulY, ULONG ulCrtc); + + #if defined(__cplusplus) + } diff --git a/x11-servers/XFree86-4-Server/files/patch-bsdResource.c b/x11-servers/XFree86-4-Server/files/patch-bsdResource.c new file mode 100644 index 000000000000..e031b2681f53 --- /dev/null +++ b/x11-servers/XFree86-4-Server/files/patch-bsdResource.c @@ -0,0 +1,68 @@ +--- programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c.orig Fri Apr 23 21:54:07 2004 ++++ programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c Tue May 17 00:48:36 2005 +@@ -18,7 +18,7 @@ + + #ifdef INCLUDE_XF86_NO_DOMAIN + +-#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) ++#if defined(__alpha__) || defined(__amd64__) + + resPtr + xf86BusAccWindowsFromOS(void) +@@ -112,7 +112,7 @@ + return ret; + } + +-#elif defined(__powerpc__) ++#elif defined(__powerpc__) || defined(__sparc__) || defined(__sparc64__) + + resPtr + xf86BusAccWindowsFromOS(void) +@@ -123,7 +123,11 @@ + RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); + ret = xf86AddResToList(ret, &range, -1); + ++#if defined(__sparc__) || defined(__sparc64__) ++ RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock); ++#else + RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); ++#endif + ret = xf86AddResToList(ret, &range, -1); + return ret; + } +@@ -137,7 +141,11 @@ + RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); + ret = xf86AddResToList(ret, &range, -1); + ++#if defined(__sparc__) || defined(__sparc64__) ++ RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock); ++#else + RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); ++#endif + ret = xf86AddResToList(ret, &range, -1); + return ret; + } +@@ -153,7 +161,11 @@ + RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); + ret = xf86AddResToList(ret, &range, -1); + ++#if defined(__sparc__) || defined(__sparc64__) ++ RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock); ++#else + RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); ++#endif + ret = xf86AddResToList(ret, &range, -1); + return ret; + } +@@ -175,7 +187,11 @@ + ret = xf86AddResToList(ret, &range, -1); + RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock); + ret = xf86AddResToList(ret, &range, -1); ++#if defined(__sparc__) || defined(__sparc64__) ++ RANGE(range, 0x00ffffff, 0x00ffffff, ResExcIoBlock); ++#else + RANGE(range, 0x0000ffff, 0x0000ffff, ResExcIoBlock); ++#endif + ret = xf86AddResToList(ret, &range, -1); + + return ret; diff --git a/x11-servers/XFree86-4-Server/files/patch-mga_driver.c b/x11-servers/XFree86-4-Server/files/patch-mga_driver.c new file mode 100644 index 000000000000..533d9ba9caf4 --- /dev/null +++ b/x11-servers/XFree86-4-Server/files/patch-mga_driver.c @@ -0,0 +1,35 @@ +Index: programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c +=================================================================== +RCS file: /cvs/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c,v +retrieving revision 1.250 +retrieving revision 1.251 +diff -u -r1.250 -r1.251 +--- programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c 18 Feb 2005 02:55:08 -0000 1.250 ++++ programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c 26 Apr 2005 00:56:43 -0000 1.251 +@@ -401,7 +401,7 @@ + "MGASetVgaMode", + "MGAValidateMode", + "MGAValidateVideoParameters", +- "MGASetDisplayStart", ++ "HALSetDisplayStart", + NULL + }; + #endif +@@ -3644,7 +3644,7 @@ + MGAAdjustGranularity(pScrn,&x,&y); + pMga->HALGranularityOffX = pMga->HALGranularityOffX - x; + pMga->HALGranularityOffY = pMga->HALGranularityOffY - y; +- MGASetDisplayStart(pMga->pBoard,x,y,0); ++ HALSetDisplayStart(pMga->pBoard,x,y,0); + ); + #endif + MGA_NOT_HAL( +@@ -3692,7 +3692,7 @@ + #ifdef USEMGAHAL + MGA_HAL( + MGAAdjustGranularity(pScrn,&x,&y); +- MGASetDisplayStart(pMga->pBoard,x,y,1); ++ HALSetDisplayStart(pMga->pBoard,x,y,1); + ); + #endif + MGA_NOT_HAL( diff --git a/x11-servers/XFree86-4-Server/pkg-message b/x11-servers/XFree86-4-Server/pkg-message deleted file mode 100644 index ea2e24612085..000000000000 --- a/x11-servers/XFree86-4-Server/pkg-message +++ /dev/null @@ -1,5 +0,0 @@ -************************************************************************ -* To improve security, the X server is installed without an SUID bit. * -* This is suitable for use with xdm, but not with a startx script. * -* If you need to use a startx script, install the x11/wrapper package. * -************************************************************************ diff --git a/x11-servers/XFree86-4-Server/scripts/configure b/x11-servers/XFree86-4-Server/scripts/configure index c4c87848d3e9..11dbf6ad85e8 100644 --- a/x11-servers/XFree86-4-Server/scripts/configure +++ b/x11-servers/XFree86-4-Server/scripts/configure @@ -64,6 +64,7 @@ do \ echo "#define $i NO" >> $LOCALDEF done +echo "#define InstallXserverSetUID ${SUID_XSERVER}" >> $LOCALDEF echo "#define BuildServer YES" >> $LOCALDEF echo "#define LibInstallBuild YES" >> $LOCALDEF echo "#define ModInstall YES" >> $LOCALDEF |