summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-10-11 23:14:37 +0000
committerroot <root@rshg054.dnsready.net>2011-10-11 23:14:37 +0000
commitf482dc1bd42773a12552e5a60df119410a0d8bd8 (patch)
tree7ef11817f41aecf969aeeb03f0dbb3cc28e2d8b4 /testing
parentcbcf42aba84733e1b9072f5320519c99bf8c0ac7 (diff)
Tue Oct 11 23:14:37 UTC 2011
Diffstat (limited to 'testing')
-rw-r--r--testing/xf86-video-savage/PKGBUILD13
-rw-r--r--testing/xorg-server/PKGBUILD14
-rw-r--r--testing/xorg-server/git-fixes.patch288
-rw-r--r--testing/xorg-server/revert-trapezoids.patch179
-rw-r--r--testing/xorg-xdm/LICENSE132
-rw-r--r--testing/xorg-xdm/PKGBUILD53
-rw-r--r--testing/xorg-xdm/Xsession-loginshell.patch15
-rw-r--r--testing/xorg-xdm/Xsession-xsm.patch22
-rw-r--r--testing/xorg-xdm/xdm-consolekit.patch225
-rw-r--r--testing/xorg-xdm/xdm.pam8
10 files changed, 939 insertions, 10 deletions
diff --git a/testing/xf86-video-savage/PKGBUILD b/testing/xf86-video-savage/PKGBUILD
index 4fa3ce4ee..aab22730c 100644
--- a/testing/xf86-video-savage/PKGBUILD
+++ b/testing/xf86-video-savage/PKGBUILD
@@ -1,9 +1,9 @@
-# $Id: PKGBUILD 136509 2011-08-30 08:45:04Z jgc $
+# $Id: PKGBUILD 140224 2011-10-10 09:15:14Z jgc $
# Maintainer: Jan de Groot <jgc@archlinux.org>
pkgname=xf86-video-savage
-pkgver=2.3.2
-pkgrel=3
+pkgver=2.3.3
+pkgrel=1
pkgdesc="X.org savage video driver"
arch=(i686 x86_64)
url="http://xorg.freedesktop.org/"
@@ -13,14 +13,11 @@ makedepends=('xorg-server-devel' 'libdrm' 'xf86driproto' 'mesa' 'glproto')
conflicts=('xorg-server<1.10.0')
options=(!libtool !makeflags)
groups=('xorg-drivers' 'xorg')
-source=(${url}/releases/individual/driver/${pkgname}-${pkgver}.tar.bz2
- git-fixes.patch)
-sha1sums=('d675693d0b29cb24f624ef57c1fe2f271f6bf6c3'
- '0ee1dd57cd48dad4d46ebcfe914b88027e44c3f1')
+source=(${url}/releases/individual/driver/${pkgname}-${pkgver}.tar.bz2)
+sha256sums=('d3854d375dbf7d83bf90e30d72837ce60d808119c6fa4bb98088e68e7cc7e7b2')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
- patch -Np1 -i "${srcdir}/git-fixes.patch"
./configure --prefix=/usr --enable-dri
make
make DESTDIR="${pkgdir}" install
diff --git a/testing/xorg-server/PKGBUILD b/testing/xorg-server/PKGBUILD
index ab8e8ae14..1de69bf3c 100644
--- a/testing/xorg-server/PKGBUILD
+++ b/testing/xorg-server/PKGBUILD
@@ -1,10 +1,10 @@
-# $Id: PKGBUILD 138468 2011-09-24 11:29:23Z jgc $
+# $Id: PKGBUILD 140222 2011-10-10 09:08:07Z jgc $
# Maintainer: Jan de Groot <jgc@archlinux.org>
pkgbase=xorg-server
pkgname=('xorg-server' 'xorg-server-xephyr' 'xorg-server-xdmx' 'xorg-server-xvfb' 'xorg-server-xnest' 'xorg-server-common' 'xorg-server-devel')
pkgver=1.11.1
-pkgrel=1
+pkgrel=2
arch=('i686' 'x86_64')
license=('custom')
url="http://xorg.freedesktop.org"
@@ -13,12 +13,16 @@ options=('!libtool')
source=(${url}/releases/individual/xserver/${pkgbase}-${pkgver}.tar.bz2
autoconfig-nvidia.patch
autoconfig-sis.patch
+ revert-trapezoids.patch
+ git-fixes.patch
xvfb-run
xvfb-run.1
10-quirks.conf)
sha1sums=('ed0358b61294f1283aad42cf1e609752ceeffafd'
'0249b892f27243d8fe6fe6d226bf4c2391cedf49'
'962fecc159c128728f14e8ba231c5b00391ff4ac'
+ 'd9f7d9553e772c2682c15079019d30c658a4f83b'
+ 'd73125bf93aea09b0beb55e75c510b9f72f5d21a'
'c94f742d3f9cabf958ae58e4015d9dd185aabedc'
'6838fc00ef4618c924a77e0fb03c05346080908a'
'993798f3d22ad672d769dae5f48d1fa068d5578f')
@@ -32,6 +36,12 @@ build() {
# Use unofficial imedia SiS driver for supported SiS devices
patch -Np0 -i "${srcdir}/autoconfig-sis.patch"
+ # Revert commit that causes huge slowdowns with binary nVidia driver
+ patch -Np1 -i "${srcdir}/revert-trapezoids.patch"
+
+ # Add post-release patches from 1.11 branch
+ patch -Np1 -i "${srcdir}/git-fixes.patch"
+
autoreconf
./configure --prefix=/usr \
--enable-ipv6 \
diff --git a/testing/xorg-server/git-fixes.patch b/testing/xorg-server/git-fixes.patch
new file mode 100644
index 000000000..3c59c27c9
--- /dev/null
+++ b/testing/xorg-server/git-fixes.patch
@@ -0,0 +1,288 @@
+From bd6ea85209e5ab80375d4ec9994d10a89fd1374a Mon Sep 17 00:00:00 2001
+From: Jamey Sharp <jamey@minilop.net>
+Date: Wed, 15 Sep 2010 01:35:21 +0000
+Subject: Fix pixmap double-frees on error paths.
+
+If AddResource fails, it will automatically free the object that was
+passed to it by calling the appropriate deleteFunc; and of course
+FreeResource also calls the deleteFunc. In both cases it's wrong to call
+the destroy hook manually.
+
+Commit by Jamey Sharp and Josh Triplett.
+
+Signed-off-by: Jamey Sharp <jamey@minilop.net>
+Signed-off-by: Josh Triplett <josh@joshtriplett.org>
+Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
+(cherry picked from commit 0f380a5005f800572773cd4667ce43c7459cc467)
+---
+diff --git a/Xext/shm.c b/Xext/shm.c
+index b08af82..4141a8f 100644
+--- a/Xext/shm.c
++++ b/Xext/shm.c
+@@ -991,7 +991,6 @@ CreatePmap:
+ pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ pMap->drawable.id = newPix->info[j].id;
+ if (!AddResource(newPix->info[j].id, RT_PIXMAP, (pointer)pMap)) {
+- (*pScreen->DestroyPixmap)(pMap);
+ result = BadAlloc;
+ break;
+ }
+@@ -1002,10 +1001,8 @@ CreatePmap:
+ }
+
+ if(result == BadAlloc) {
+- while(j--) {
+- (*pScreen->DestroyPixmap)(pMap);
++ while(j--)
+ FreeResource(newPix->info[j].id, RT_NONE);
+- }
+ free(newPix);
+ } else
+ AddResource(stuff->pid, XRT_PIXMAP, newPix);
+@@ -1110,7 +1107,6 @@ CreatePmap:
+ {
+ return Success;
+ }
+- pDraw->pScreen->DestroyPixmap(pMap);
+ }
+ return BadAlloc;
+ }
+diff --git a/dix/dispatch.c b/dix/dispatch.c
+index 192c8c3..f8200b1 100644
+--- a/dix/dispatch.c
++++ b/dix/dispatch.c
+@@ -1419,7 +1419,6 @@ CreatePmap:
+ }
+ if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap))
+ return Success;
+- (*pDraw->pScreen->DestroyPixmap)(pMap);
+ }
+ return BadAlloc;
+ }
+--
+cgit v0.9.0.2-2-gbebe
+From 347f5610ca023fb31485aa19c20607af8bf9c834 Mon Sep 17 00:00:00 2001
+From: Carlos Garnacho <carlosg@gnome.org>
+Date: Tue, 30 Aug 2011 22:46:52 +0000
+Subject: Xi: Fix passive XI2 ungrabs on XIAll[Master]Devices
+
+The corresponding DeviceIntPtr wasn't being gotten properly,
+resulting in BadDevice from dixLookupDevice().
+
+Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
+Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+(cherry picked from commit f52d5cd374563544dafe29587411f345e31bbdf8)
+---
+diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c
+index ae43433..5cdd8ac 100644
+--- a/Xi/xipassivegrab.c
++++ b/Xi/xipassivegrab.c
+@@ -261,9 +261,16 @@ ProcXIPassiveUngrabDevice(ClientPtr client)
+ REQUEST(xXIPassiveUngrabDeviceReq);
+ REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq);
+
+- rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
+- if (rc != Success)
+- return rc;
++ if (stuff->deviceid == XIAllDevices)
++ dev = inputInfo.all_devices;
++ else if (stuff->deviceid == XIAllMasterDevices)
++ dev = inputInfo.all_master_devices;
++ else
++ {
++ rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
++ if (rc != Success)
++ return rc;
++ }
+
+ if (stuff->grab_type != XIGrabtypeButton &&
+ stuff->grab_type != XIGrabtypeKeycode &&
+--
+cgit v0.9.0.2-2-gbebe
+From e9ae33316012ffe9acfeeb7303ab3392c2ca2a2b Mon Sep 17 00:00:00 2001
+From: Sam Spilsbury <sam.spilsbury@canonical.com>
+Date: Wed, 14 Sep 2011 01:58:34 +0000
+Subject: Remove the SendEvent bit (0x80) before doing range checks on event type.
+
+Some extension libraries may set this bit before converting the event to
+wire protocol and as such range checking the event will cause an invalid
+BadValue error to result. As the documentation suggests the the bit
+should be "forced on", remove it before doing range checks and continue
+to force it on in the server.
+
+Reviewed-by: Jamey Sharp <jamey@minilop.net>
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+(cherry picked from commit 2d2dce558d24eeea0eb011ec9ebaa6c5c2273c39)
+---
+diff --git a/dix/events.c b/dix/events.c
+index 8a4c6b9..9e58edb 100644
+--- a/dix/events.c
++++ b/dix/events.c
+@@ -5224,6 +5224,8 @@ CloseDownEvents(void)
+ InputEventList = NULL;
+ }
+
++#define SEND_EVENT_BIT 0x80
++
+ /**
+ * Server-side protocol handling for SendEvent request.
+ *
+@@ -5241,6 +5243,16 @@ ProcSendEvent(ClientPtr client)
+
+ REQUEST_SIZE_MATCH(xSendEventReq);
+
++ /* libXext and other extension libraries may set the bit indicating
++ * that this event came from a SendEvent request so remove it
++ * since otherwise the event type may fail the range checks
++ * and cause an invalid BadValue error to be returned.
++ *
++ * This is safe to do since we later add the SendEvent bit (0x80)
++ * back in once we send the event to the client */
++
++ stuff->event.u.u.type &= ~(SEND_EVENT_BIT);
++
+ /* The client's event type must be a core event type or one defined by an
+ extension. */
+
+@@ -5298,7 +5310,7 @@ ProcSendEvent(ClientPtr client)
+ client->errorValue = stuff->propagate;
+ return BadValue;
+ }
+- stuff->event.u.u.type |= 0x80;
++ stuff->event.u.u.type |= SEND_EVENT_BIT;
+ if (stuff->propagate)
+ {
+ for (;pWin; pWin = pWin->parent)
+--
+cgit v0.9.0.2-2-gbebe
+From b45e22675364915c32560c26404cf30d77ab68aa Mon Sep 17 00:00:00 2001
+From: Alan Hourihane <alanh@vmware.com>
+Date: Wed, 05 Oct 2011 02:42:46 +0000
+Subject: dixfonts: Don't overwrite local c variable until new_closure is safely initialized.
+
+Signed-off-by: Alan Hourihane <alanh@vmware.com>
+Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+(cherry picked from commit 7a33c5b934382b5554f41ab1502514e91c9bc52e)
+---
+diff --git a/dix/dixfonts.c b/dix/dixfonts.c
+index fbac124..d2bcb84 100644
+--- a/dix/dixfonts.c
++++ b/dix/dixfonts.c
+@@ -1302,31 +1302,30 @@ doPolyText(ClientPtr client, PTclosurePtr c)
+ goto bail;
+ }
+ *new_closure = *c;
+- c = new_closure;
+
+- len = c->endReq - c->pElt;
+- c->data = malloc(len);
+- if (!c->data)
++ len = new_closure->endReq - new_closure->pElt;
++ new_closure->data = malloc(len);
++ if (!new_closure->data)
+ {
+- free(c);
++ free(new_closure);
+ err = BadAlloc;
+ goto bail;
+ }
+- memmove(c->data, c->pElt, len);
+- c->pElt = c->data;
+- c->endReq = c->pElt + len;
++ memmove(new_closure->data, new_closure->pElt, len);
++ new_closure->pElt = new_closure->data;
++ new_closure->endReq = new_closure->pElt + len;
+
+ /* Step 2 */
+
+- pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen);
++ pGC = GetScratchGC(new_closure->pGC->depth, new_closure->pGC->pScreen);
+ if (!pGC)
+ {
+- free(c->data);
+- free(c);
++ free(new_closure->data);
++ free(new_closure);
+ err = BadAlloc;
+ goto bail;
+ }
+- if ((err = CopyGC(c->pGC, pGC, GCFunction |
++ if ((err = CopyGC(new_closure->pGC, pGC, GCFunction |
+ GCPlaneMask | GCForeground |
+ GCBackground | GCFillStyle |
+ GCTile | GCStipple |
+@@ -1337,15 +1336,16 @@ doPolyText(ClientPtr client, PTclosurePtr c)
+ Success)
+ {
+ FreeScratchGC(pGC);
+- free(c->data);
+- free(c);
++ free(new_closure->data);
++ free(new_closure);
+ err = BadAlloc;
+ goto bail;
+ }
++ c = new_closure;
+ origGC = c->pGC;
+ c->pGC = pGC;
+ ValidateGC(c->pDraw, c->pGC);
+-
++
+ ClientSleep(client, (ClientSleepProcPtr)doPolyText, c);
+
+ /* Set up to perform steps 3 and 4 */
+--
+cgit v0.9.0.2-2-gbebe
+From bec15eb73a17fb47963ff6b747ea504f7dc05deb Mon Sep 17 00:00:00 2001
+From: Kirill Elagin <kirelagin@gmail.com>
+Date: Tue, 04 Oct 2011 19:02:20 +0000
+Subject: Fix server crash due to invalid images
+
+See https://bugs.freedesktop.org/show_bug.cgi?id=39383
+
+Signed-off-by: Kirill Elagin <kirelagin@gmail.com>
+Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+(cherry picked from commit 53611213396479abfdce0f7752681572e0d26d78)
+---
+diff --git a/fb/fbpict.c b/fb/fbpict.c
+index d1fd0cb..57c93fd 100644
+--- a/fb/fbpict.c
++++ b/fb/fbpict.c
+@@ -163,7 +163,9 @@ create_bits_picture (PicturePtr pict,
+ (pixman_format_code_t)pict->format,
+ pixmap->drawable.width, pixmap->drawable.height,
+ (uint32_t *)bits, stride * sizeof (FbStride));
+-
++
++ if (!image)
++ return NULL;
+
+ #ifdef FB_ACCESS_WRAPPER
+ #if FB_SHIFT==5
+--
+cgit v0.9.0.2-2-gbebe
+From 65469f5ea98074ab27ce0a2d482157b9d5c2cbc7 Mon Sep 17 00:00:00 2001
+From: vdb@picaros.org <vdb@picaros.org>
+Date: Sat, 17 Sep 2011 16:55:47 +0000
+Subject: Fix a rare memory leak
+
+Signed-off-by: Servaas Vandenberghe <vdb@picaros.org>
+Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+(cherry picked from commit e4cddf509e1729e8ff40354275b65455111ad2bd)
+---
+diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
+index c2814d4..3fae039 100644
+--- a/hw/xfree86/modes/xf86Crtc.c
++++ b/hw/xfree86/modes/xf86Crtc.c
+@@ -133,6 +133,7 @@ xf86CrtcCreate (ScrnInfoPtr scrn,
+ crtcs = malloc((xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr));
+ if (!crtcs)
+ {
++ free(crtc->gamma_red);
+ free(crtc);
+ return NULL;
+ }
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/testing/xorg-server/revert-trapezoids.patch b/testing/xorg-server/revert-trapezoids.patch
new file mode 100644
index 000000000..b9046c5cb
--- /dev/null
+++ b/testing/xorg-server/revert-trapezoids.patch
@@ -0,0 +1,179 @@
+diff -ru a/fb/fbpict.c b/fb/fbpict.c
+--- a/fb/fbpict.c 2011-08-01 01:44:24.000000000 +0200
++++ b/fb/fbpict.c 2011-10-05 22:45:29.000000000 +0200
+@@ -364,7 +364,7 @@
+ ps->Glyphs = miGlyphs;
+ ps->CompositeRects = miCompositeRects;
+ ps->RasterizeTrapezoid = fbRasterizeTrapezoid;
+- ps->Trapezoids = fbTrapezoids;
++ ps->Trapezoids = miTrapezoids;
+ ps->AddTraps = fbAddTraps;
+ ps->AddTriangles = fbAddTriangles;
+ ps->Triangles = fbTriangles;
+diff -ru a/render/mipict.c b/render/mipict.c
+--- a/render/mipict.c 2011-04-04 05:19:50.000000000 +0200
++++ b/render/mipict.c 2011-10-05 22:02:53.000000000 +0200
+@@ -573,6 +573,67 @@
+ }
+ }
+
++void
++miTrapezoids (CARD8 op,
++ PicturePtr pSrc,
++ PicturePtr pDst,
++ PictFormatPtr maskFormat,
++ INT16 xSrc,
++ INT16 ySrc,
++ int ntrap,
++ xTrapezoid *traps)
++{
++ ScreenPtr pScreen = pDst->pDrawable->pScreen;
++ PictureScreenPtr ps = GetPictureScreen(pScreen);
++
++ /*
++ * Check for solid alpha add
++ */
++ if (op == PictOpAdd && miIsSolidAlpha (pSrc))
++ {
++ for (; ntrap; ntrap--, traps++)
++ (*ps->RasterizeTrapezoid) (pDst, traps, 0, 0);
++ }
++ else if (maskFormat)
++ {
++ PicturePtr pPicture;
++ BoxRec bounds;
++ INT16 xDst, yDst;
++ INT16 xRel, yRel;
++
++ xDst = traps[0].left.p1.x >> 16;
++ yDst = traps[0].left.p1.y >> 16;
++
++ miTrapezoidBounds (ntrap, traps, &bounds);
++ if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
++ return;
++ pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat,
++ bounds.x2 - bounds.x1,
++ bounds.y2 - bounds.y1);
++ if (!pPicture)
++ return;
++ for (; ntrap; ntrap--, traps++)
++ (*ps->RasterizeTrapezoid) (pPicture, traps,
++ -bounds.x1, -bounds.y1);
++ xRel = bounds.x1 + xSrc - xDst;
++ yRel = bounds.y1 + ySrc - yDst;
++ CompositePicture (op, pSrc, pPicture, pDst,
++ xRel, yRel, 0, 0, bounds.x1, bounds.y1,
++ bounds.x2 - bounds.x1,
++ bounds.y2 - bounds.y1);
++ FreePicture (pPicture, 0);
++ }
++ else
++ {
++ if (pDst->polyEdge == PolyEdgeSharp)
++ maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1);
++ else
++ maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
++ for (; ntrap; ntrap--, traps++)
++ miTrapezoids (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, traps);
++ }
++}
++
+ Bool
+ miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
+ {
+@@ -599,7 +660,7 @@
+ ps->Composite = 0; /* requires DDX support */
+ ps->Glyphs = miGlyphs;
+ ps->CompositeRects = miCompositeRects;
+- ps->Trapezoids = 0;
++ ps->Trapezoids = miTrapezoids;
+ ps->Triangles = 0;
+
+ ps->RasterizeTrapezoid = 0; /* requires DDX support */
+diff -ru a/render/mipict.h b/render/mipict.h
+--- a/render/mipict.h 2011-04-04 05:19:50.000000000 +0200
++++ b/render/mipict.h 2011-10-05 22:06:19.000000000 +0200
+@@ -129,6 +129,23 @@
+ CARD32 pixel,
+ xRenderColor *color);
+
++extern _X_EXPORT PicturePtr
++miCreateAlphaPicture (ScreenPtr pScreen,
++ PicturePtr pDst,
++ PictFormatPtr pPictFormat,
++ CARD16 width,
++ CARD16 height);
++
++extern _X_EXPORT void
++miTrapezoids (CARD8 op,
++ PicturePtr pSrc,
++ PicturePtr pDst,
++ PictFormatPtr maskFormat,
++ INT16 xSrc,
++ INT16 ySrc,
++ int ntrap,
++ xTrapezoid *traps);
++
+ extern _X_EXPORT Bool
+ miIsSolidAlpha (PicturePtr pSrc);
+
+diff -ru a/render/mitrap.c b/render/mitrap.c
+--- a/render/mitrap.c 2011-04-04 05:19:50.000000000 +0200
++++ b/render/mitrap.c 2011-10-05 22:05:29.000000000 +0200
+@@ -34,6 +34,55 @@
+ #include "picturestr.h"
+ #include "mipict.h"
+
++PicturePtr
++miCreateAlphaPicture (ScreenPtr pScreen,
++ PicturePtr pDst,
++ PictFormatPtr pPictFormat,
++ CARD16 width,
++ CARD16 height)
++{
++ PixmapPtr pPixmap;
++ PicturePtr pPicture;
++ GCPtr pGC;
++ int error;
++ xRectangle rect;
++
++ if (width > 32767 || height > 32767)
++ return 0;
++
++ if (!pPictFormat)
++ {
++ if (pDst->polyEdge == PolyEdgeSharp)
++ pPictFormat = PictureMatchFormat (pScreen, 1, PICT_a1);
++ else
++ pPictFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
++ if (!pPictFormat)
++ return 0;
++ }
++
++ pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
++ pPictFormat->depth, 0);
++ if (!pPixmap)
++ return 0;
++ pGC = GetScratchGC (pPixmap->drawable.depth, pScreen);
++ if (!pGC)
++ {
++ (*pScreen->DestroyPixmap) (pPixmap);
++ return 0;
++ }
++ ValidateGC (&pPixmap->drawable, pGC);
++ rect.x = 0;
++ rect.y = 0;
++ rect.width = width;
++ rect.height = height;
++ (*pGC->ops->PolyFillRect)(&pPixmap->drawable, pGC, 1, &rect);
++ FreeScratchGC (pGC);
++ pPicture = CreatePicture (0, &pPixmap->drawable, pPictFormat,
++ 0, 0, serverClient, &error);
++ (*pScreen->DestroyPixmap) (pPixmap);
++ return pPicture;
++}
++
+ static xFixed
+ miLineFixedX (xLineFixed *l, xFixed y, Bool ceil)
+ {
+
diff --git a/testing/xorg-xdm/LICENSE b/testing/xorg-xdm/LICENSE
new file mode 100644
index 000000000..5f8d6fcc0
--- /dev/null
+++ b/testing/xorg-xdm/LICENSE
@@ -0,0 +1,132 @@
+This package was downloaded from
+http://xorg.freedesktop.org/releases/individual/app/
+
+Copyright 1988, 1989, 1990, 1991, 1994, 1998
+The Open Group
+Copyright 2002 Sun Microsystems, Inc. All rights reserved.
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+prngc.c:
+Copyright (c) 1995,1999 Theo de Raadt. All rights reserved.
+Copyright (c) 2001-2002 Damien Miller. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+dm_socket.h, dm_error.h, dm_auth.h
+Copyright 1998 by Thomas E. Dickey <dickey@clark.net>
+
+ All Rights Reserved
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name(s) of the above copyright
+holders shall not be used in advertising or otherwise to promote the
+sale, use or other dealings in this Software without prior written
+authorization.
+
+genauth.c:
+Copyright Theodore Ts'o, 1994, 1995, 1996, 1997, 1998, 1999. All
+rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, and the entire permission notice in its entirety,
+ including the disclaimer of warranties.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF
+WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+
+Makefile.am
+Copyright 2005 Red Hat, Inc.
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation, and that the name of Red Hat not be used in
+advertising or publicity pertaining to distribution of the software without
+specific, written prior permission. Red Hat makes no
+representations about the suitability of this software for any purpose. It
+is provided "as is" without express or implied warranty.
+
+RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
diff --git a/testing/xorg-xdm/PKGBUILD b/testing/xorg-xdm/PKGBUILD
new file mode 100644
index 000000000..38924762a
--- /dev/null
+++ b/testing/xorg-xdm/PKGBUILD
@@ -0,0 +1,53 @@
+# $Id: PKGBUILD 140230 2011-10-10 10:30:55Z jgc $
+# Maintainer: Alexander Baldeck <alexander@archlinux.org>
+# Contributor: Jan de Groot <jgc@archlinux.org>
+pkgname=xorg-xdm
+pkgver=1.1.11
+pkgrel=1
+pkgdesc="X Display Manager"
+arch=(i686 x86_64)
+url="http://xorg.freedesktop.org/"
+license=('custom')
+depends=('pam' 'libxaw' 'libxinerama' 'xorg-xrdb' 'xorg-sessreg' 'libxft' 'consolekit')
+makedepends=('pkgconfig' 'xorg-util-macros')
+backup=(etc/X11/xdm/Xaccess etc/X11/xdm/Xresources etc/X11/xdm/Xservers etc/X11/xdm/xdm-config etc/pam.d/xdm etc/X11/xdm/Xsetup_0 etc/X11/xdm/Xsession)
+options=('!libtool')
+source=(${url}/releases/individual/app/xdm-${pkgver}.tar.bz2
+ Xsession-loginshell.patch
+ Xsession-xsm.patch
+ xdm-consolekit.patch
+ xdm.pam)
+md5sums=('64a1af1f7eb69feae12e75d4cc3aaf19'
+ '234ae568e7b22cbc09433bb396ff3d80'
+ '2c30078c50bc653d72eb5114506eb313'
+ '46b11173b58e2241577d5ffd48ab8f8d'
+ '419d6289ba6f851135f5c70c0e3cbec4')
+sha256sums=('d4da426ddea0124279a3f2e00a26db61944690628ee818a64df9d27352081c47'
+ 'fd3e7c20837b42a8ab111369fd6dc9612f9edb91c1f6904cca1d6a1fa3cfa0ff'
+ '77a1ce9bdf363591b72798db08b4df3589bd4e64737fd32cf9028f9245450edb'
+ '47190f311c97c0d85b1fcab47ee5a8575013db1200a5e30a57a7ea4ef3e0c23a'
+ '36cf924a893ef851855ebcdc5468523a9d182c3620698e01dffc35d05d74764b')
+
+build() {
+ cd "${srcdir}/xdm-${pkgver}"
+ patch -Np0 -i "${srcdir}/Xsession-loginshell.patch"
+ patch -Np1 -i "${srcdir}/Xsession-xsm.patch"
+ patch -Np1 -i "${srcdir}/xdm-consolekit.patch"
+
+ autoreconf -fi
+ ./configure --prefix=/usr \
+ --disable-xdm-auth \
+ --disable-static \
+ --with-xdmconfigdir=/etc/X11/xdm \
+ --with-xdmscriptdir=/etc/X11/xdm \
+ --with-pixmapdir=/usr/share/xdm/pixmaps
+ make
+ make DESTDIR="${pkgdir}" install
+ install -m755 -d "${pkgdir}/var/lib/xdm"
+ install -m755 -d "${pkgdir}/etc/pam.d"
+ install -m644 "${srcdir}/xdm.pam" "${pkgdir}/etc/pam.d/xdm"
+ install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
+ install -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/"
+
+ sed -i -e 's/\/X11R6//g' "${pkgdir}"/etc/X11/xdm/*
+}
diff --git a/testing/xorg-xdm/Xsession-loginshell.patch b/testing/xorg-xdm/Xsession-loginshell.patch
new file mode 100644
index 000000000..3710752ef
--- /dev/null
+++ b/testing/xorg-xdm/Xsession-loginshell.patch
@@ -0,0 +1,15 @@
+--- config/Xsession.cpp.orig 2008-06-21 13:57:36.000000000 +0000
++++ config/Xsession.cpp 2008-06-21 14:01:25.000000000 +0000
+@@ -56,11 +56,7 @@
+ resources=$HOME/.Xresources
+
+ if [ -s "$startup" ]; then
+- if [ -x "$startup" ]; then
+- exec "$startup"
+- else
+- exec /bin/sh "$startup"
+- fi
++ exec /bin/sh -ls -c "$startup"
+ else
+ if [ -r "$resources" ]; then
+ BINDIR/xrdb -load "$resources"
diff --git a/testing/xorg-xdm/Xsession-xsm.patch b/testing/xorg-xdm/Xsession-xsm.patch
new file mode 100644
index 000000000..a2d4d6cc6
--- /dev/null
+++ b/testing/xorg-xdm/Xsession-xsm.patch
@@ -0,0 +1,22 @@
+diff -Naur xdm-1.1.8-orig/config/Xsession.cpp xdm-1.1.8/config/Xsession.cpp
+--- xdm-1.1.8-orig/config/Xsession.cpp 2008-05-21 14:08:45.000000000 -0400
++++ xdm-1.1.8/config/Xsession.cpp 2009-04-28 02:56:11.000000000 -0400
+@@ -54,6 +54,7 @@
+
+ startup=$HOME/.xsession
+ resources=$HOME/.Xresources
++xinitrc=$HOME/.xinitrc
+
+ if [ -s "$startup" ]; then
+ if [ -x "$startup" ]; then
+@@ -83,5 +84,9 @@
+ exec `eval $XDESKTOP`
+ }
+ #endif
+- exec BINDIR/xsm
++ if [ -r "$xinitrc" ]; then
++ exec /bin/sh -ls -c "$xinitrc"
++ else
++ exec /bin/sh -l /etc/X11/xinit/xinitrc
++ fi
+ fi
diff --git a/testing/xorg-xdm/xdm-consolekit.patch b/testing/xorg-xdm/xdm-consolekit.patch
new file mode 100644
index 000000000..7d85b97e0
--- /dev/null
+++ b/testing/xorg-xdm/xdm-consolekit.patch
@@ -0,0 +1,225 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -362,6 +362,20 @@
+
+ AM_CONDITIONAL(DYNAMIC_GREETER, test x$DYNAMIC_GREETER = xyes)
+
++# ConsoleKit support
++AC_ARG_WITH(consolekit, AC_HELP_STRING([--with-consolekit], [Use ConsoleKit]),
++ [USE_CONSOLEKIT=$withval], [USE_CONSOLEKIT=yes])
++if test x"$USE_CONSOLEKIT" != xno; then
++ PKG_CHECK_MODULES(CK_CONNECTOR, ck-connector,
++ [USE_CONSOLEKIT=yes], [USE_CONSOLEKIT=no])
++ if test x"$USE_CONSOLEKIT" = xyes; then
++ AC_DEFINE([USE_CONSOLEKIT], 1, [Define to 1 to use ConsoleKit])
++ XDM_CFLAGS="$XDM_CFLAGS $CK_CONNECTOR_CFLAGS -DUSE_CONSOLEKIT"
++ XDM_LIBS="$XDM_LIBS $CK_CONNECTOR_LIBS"
++ fi
++fi
++dnl AM_CONDITIONAL(USE_CONSOLEKIT, test$USE_CONSOLEKIT = xyes)
++
+ #
+ # XDM
+ #
+--- a/xdm/session.c
++++ b/xdm/session.c
+@@ -66,6 +66,11 @@
+ #endif
+ #endif /* USE_PAM */
+
++#ifdef USE_CONSOLEKIT
++#include <ck-connector.h>
++#include <dbus/dbus.h>
++#endif
++
+ #ifdef __SCO__
+ #include <prot.h>
+ #endif
+@@ -472,6 +477,97 @@
+ }
+ }
+
++#ifdef USE_CONSOLEKIT
++
++static CkConnector *connector;
++
++static int openCKSession(struct verify_info *verify, struct display *d)
++{
++ int ret;
++ DBusError error;
++ char *remote_host_name = "";
++ dbus_bool_t is_local;
++ char *display_name = "";
++ char *display_device = "";
++ char devtmp[16];
++
++ if (!use_consolekit)
++ return 1;
++
++ is_local = d->displayType.location == Local;
++ if (d->peerlen > 0 && d->peer)
++ remote_host_name = d->peer;
++ if (d->name)
++ display_name = d->name;
++ /* how can we get the corresponding tty at best...? */
++ if (d->windowPath) {
++ display_device = strchr(d->windowPath, ':');
++ if (display_device && display_device[1])
++ display_device++;
++ else
++ display_device = d->windowPath;
++ snprintf(devtmp, sizeof(devtmp), "/dev/tty%s", display_device);
++ display_device = devtmp;
++ }
++
++ connector = ck_connector_new();
++ if (!connector) {
++ LogOutOfMem("ck_connector");
++ return 0;
++ }
++
++ dbus_error_init(&error);
++ ret = ck_connector_open_session_with_parameters(
++ connector, &error,
++ "unix-user", &verify->uid,
++ "x11-display", &display_name,
++ "x11-display-device", &display_device,
++ "remote-host-name", &remote_host_name,
++ "is-local", &is_local,
++ NULL);
++ if (!ret) {
++ if (dbus_error_is_set(&error)) {
++ LogError("Dbus error: %s\n", error.message);
++ dbus_error_free(&error);
++ } else {
++ LogError("ConsoleKit error\n");
++ }
++ LogError("console-kit-daemon not running?\n");
++ ck_connector_unref(connector);
++ connector = NULL;
++ return 0;
++ }
++
++ verify->userEnviron = setEnv(verify->userEnviron,
++ "XDG_SESSION_COOKIE", ck_connector_get_cookie(connector));
++ return 1;
++}
++
++static void closeCKSession(void)
++{
++ DBusError error;
++
++ if (!connector)
++ return;
++
++ dbus_error_init(&error);
++ if (!ck_connector_close_session(connector, &error)) {
++ if (dbus_error_is_set(&error)) {
++ LogError("Dbus error: %s\n", error.message);
++ dbus_error_free(&error);
++ } else {
++ LogError("ConsoleKit close error\n");
++ }
++ LogError("console-kit-daemon not running?\n");
++ }
++ ck_connector_unref(connector);
++ connector = NULL;
++}
++#else
++#define openCKSession(v,d) 1
++#define closeCKSession()
++#endif
++
+ void
+ SessionExit (struct display *d, int status, int removeAuth)
+ {
+@@ -486,6 +580,8 @@
+ }
+ #endif
+
++ closeCKSession();
++
+ /* make sure the server gets reset after the session is over */
+ if (d->serverPid >= 2 && d->resetSignal)
+ kill (d->serverPid, d->resetSignal);
+@@ -568,6 +664,10 @@
+ #ifdef USE_PAM
+ if (pamh) pam_open_session(pamh, 0);
+ #endif
++
++ if (!openCKSession(verify, d))
++ return 0;
++
+ switch (pid = fork ()) {
+ case 0:
+ CleanUpChild ();
+--- a/include/dm.h
++++ b/include/dm.h
+@@ -325,6 +325,9 @@
+ extern char *prngdSocket;
+ extern int prngdPort;
+ # endif
++#ifdef USE_CONSOLEKIT
++extern int use_consolekit;
++#endif
+
+ extern char *greeterLib;
+ extern char *willing;
+--- a/xdm/resource.c
++++ b/xdm/resource.c
+@@ -68,6 +68,9 @@
+ char *prngdSocket;
+ int prngdPort;
+ #endif
++#ifdef USE_CONSOLEKIT
++int use_consolekit;
++#endif
+
+ char *greeterLib;
+ char *willing;
+@@ -258,6 +261,10 @@
+ "false"} ,
+ { "willing", "Willing", DM_STRING, &willing,
+ ""} ,
++#ifdef USE_CONSOLEKIT
++{ "consoleKit", "ConsoleKit", DM_BOOL, (char **) &use_consolekit,
++ "true"} ,
++#endif
+ };
+
+ # define NUM_DM_RESOURCES (sizeof DmResources / sizeof DmResources[0])
+@@ -440,7 +447,11 @@
+ {"-debug", "*debugLevel", XrmoptionSepArg, (caddr_t) NULL },
+ {"-xrm", NULL, XrmoptionResArg, (caddr_t) NULL },
+ {"-daemon", ".daemonMode", XrmoptionNoArg, "true" },
+-{"-nodaemon", ".daemonMode", XrmoptionNoArg, "false" }
++{"-nodaemon", ".daemonMode", XrmoptionNoArg, "false" },
++#ifdef USE_CONSOLEKIT
++{"-consolekit", ".consoleKit", XrmoptionNoArg, "true" },
++{"-noconsolekit", ".consoleKit", XrmoptionNoArg, "false" }
++#endif
+ };
+
+ static int originalArgc;
+--- a/man/xdm.man
++++ b/man/xdm.man
+@@ -51,6 +51,8 @@
+ ] [
+ .B \-session
+ .I session_program
++] [
++.B \-noconsolekit
+ ]
+ .SH DESCRIPTION
+ .I Xdm
+@@ -218,6 +220,10 @@
+ .IP "\fB\-xrm\fP \fIresource_specification\fP"
+ Allows an arbitrary resource to be specified, as in most
+ X Toolkit applications.
++.IP "\fB\-noconsolekit\fP"
++Specifies ``false'' as the value for the \fBDisplayManager.consoleKit\fP
++resource.
++This suppresses the session management using ConsoleKit.
+ .SH RESOURCES
+ At many stages the actions of
+ .I xdm
diff --git a/testing/xorg-xdm/xdm.pam b/testing/xorg-xdm/xdm.pam
new file mode 100644
index 000000000..862b83fa2
--- /dev/null
+++ b/testing/xorg-xdm/xdm.pam
@@ -0,0 +1,8 @@
+#%PAM-1.0
+auth required pam_unix.so
+auth required pam_nologin.so
+auth required pam_env.so
+account required pam_unix.so
+password required pam_unix.so
+session required pam_unix.so
+session required pam_limits.so