1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-26 00:55:14 +00:00

- 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]
This commit is contained in:
Dejan Lesjak 2005-06-20 18:30:39 +00:00
parent d9e60aea40
commit b450fc1e84
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=137786
6 changed files with 144 additions and 14 deletions

View File

@ -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>

View File

@ -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)
}

View File

@ -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;

View File

@ -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(

View File

@ -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. *
************************************************************************

View File

@ -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