summaryrefslogtreecommitdiff
path: root/x11-apps/xdm
diff options
context:
space:
mode:
Diffstat (limited to 'x11-apps/xdm')
-rw-r--r--x11-apps/xdm/Manifest4
-rw-r--r--x11-apps/xdm/files/xdm-1.1.12-consolekit.patch269
-rw-r--r--x11-apps/xdm/files/xdm-1.1.12-make-xinerama-optional.patch34
-rw-r--r--x11-apps/xdm/xdm-1.1.12.ebuild84
4 files changed, 391 insertions, 0 deletions
diff --git a/x11-apps/xdm/Manifest b/x11-apps/xdm/Manifest
index d94c8af79ece..65a8adedc4f3 100644
--- a/x11-apps/xdm/Manifest
+++ b/x11-apps/xdm/Manifest
@@ -2,7 +2,11 @@ AUX Xsession 1521 BLAKE2B cb2090c2f2c1626df08fe45e80ab668ec9ca43f8f647f9a16d09e7
AUX xdm-1.1.11-arc4random-include.patch 360 BLAKE2B e16532b9e360d735d63d641fcad7a4242d227a5df2715be24d2907115f88e00b0e298ad3aa465a6f4e5b931928d46cbc0ef54cc1e7ea71d23dd60995bbec201b SHA512 2da1c4972c7edcd6c3fc42f29c15ce875888cc582a18e1932a60c3d0881a5a96991129bf5bb8c6649f0731e2102c0a163928c089d7ff9fe19ef82d470f86882f
AUX xdm-1.1.11-cve-2013-2179.patch 1519 BLAKE2B cd0329d5c97b4bd5051dcd594bf54676004c1abcedefd9c7cbdcfe500bcbcf79cf4a22e9977860b553d8d5d1e79d3514206200bf8b0b8d6e20989df7cb7ca825 SHA512 5890051b134f1ed8f68846ee47d38375fbd0b4c639b9ae834b27d5b1749456aba4e1000a16a16d387072845887685375b1d87c4ce3870cc2acda58c4f17d45ae
AUX xdm-1.1.11-setproctitle-include.patch 849 BLAKE2B cd5749feb0d11d07208922e94cef14a7063c43b7a05a804c09f6febabfa35941914e8f8d508992f52bc7804aeee12e98525cf5f854250e30a4470ef7389c9b3b SHA512 496ad42ee35ce6d25f87b349330394f65cc8979b388759d7e03636f96bc2272068a999a9f7ac3b2e0486099b7678ef1c0e30505c3e0a08cc3041121936f1abb0
+AUX xdm-1.1.12-consolekit.patch 7815 BLAKE2B 1ef67b15385c3cc9a74797fadc34e5701889bf669f70e9c3720a82db595472dcf8fc36011ce35cad763dc68580a7680a272c7617d9cf58db8314f788974031cd SHA512 e318ebe0e606964712db40cb70177d4aa275679ef6e2c0ca97cd5156434d037e8774bc75dad3584e8d13ad4577798fac6624bdb6359f1a57de9eb2961bfdc5f7
+AUX xdm-1.1.12-make-xinerama-optional.patch 978 BLAKE2B feb81c4815c61c62ebd25acec572de03450c4ee5fd7a634cb0444e17d35566548c0bc8dab05562264533676012410839f61b2e5cb5bc98d83bf9a36daa1b59cc SHA512 efddf2cd662cc4e1ca5cea2a9efe49b4ef8e98276f37def047091088a9deaaadc61646deeefbd8668286d08edabd245a532db84ddf938a2853bdcc1865c221c9
AUX xdm-consolekit.patch 5712 BLAKE2B 0526aad6742c86d878ca01204a2e6c781dc4532f7de573a67723e4ab3c7dacefe20d25766402b705c957db75fbf41d396c46442e7da500ad3ce2afb3f0facc67 SHA512 d87ec56e4b7d067709679f222d3bd9009f1496d66c3c4335458b54e2a468200e3c7ac99843330c23bad7049995c93e8f3c74f3161529c6fb488e94e9fcd4752a
DIST xdm-1.1.11.tar.bz2 446612 BLAKE2B ce9bed568e036a882ecc56d75f7ce8646d14ae00c754d6e5542ea5b186c3ef1ce8499e2d70190b4fbc4b344e0c70fd36deab5aacc5f1f55501db709300aee520 SHA512 fe6f2b7817c0f7f07a1f5f497edcdfa15b93986fd87f314daa472dac8625327ef46ebbf40d27fe8d4a8a2f8d5af8a01c4438a29356740e0eb350f2bd0c7ec0d5
+DIST xdm-1.1.12.tar.bz2 512074 BLAKE2B a82d124f4b7ce3185d703fca3aade92e86094602aec5343566ba8c91c54b70cdedbaea2fa6fee330d7ed48d9138b04a998aa2dae06db2683bfcce6c7693edc82 SHA512 1a4be0a070ced5db8fda6fc74794c9f9ed0cb37fa440fda6a3a7652aff62dfc3d7ba68b9facf054671ebf0f4db2a0eec29d0aa3716e3407ccd5529bac3553bdb
EBUILD xdm-1.1.11-r3.ebuild 1807 BLAKE2B 1c98b7e9ea0bb96ccd82c355d3e4fb16641eadc41167fd5d559927405c95b7153f0aea14d3a906540d053c2f88d289330007bf312c1e8470fa98d04efd68c78c SHA512 7d30353885804970be0e0fd31c455d9ff52615ad1ae2611da2ab30705e048114221bf78de639bc05923ea3eeca4af251fa3b6935e7100c3a987db6e01532ab8a
+EBUILD xdm-1.1.12.ebuild 1962 BLAKE2B e1a1052aa6085fe6fd9dcba43cd36ef12c4f11de44be96154c4e088ac3a6a452e7d0f1c62a76bc9f30420b7d26f305307cefae3acb3cd8918cc097d170214292 SHA512 479c779494675dc951e1f0f9c54fc58ea514beb1743544f4949723d92099008c8955b4148f14313f3cccf717f462d74e547e10cbfa594155337496a713062822
MISC metadata.xml 414 BLAKE2B 6e4d9441a5a392ed6a989fbfd08b9e664dfd6843fa6b6f4f9644b4ace383cd5ed8ea859a0f6e1d34580fd8acac06333eb566bf6460144128494a046991fe08c0 SHA512 f3acd7a9e8f8e1d93ca5c657409efbaeb5695dc81528926d9ecdc517cff8a7c2f597b9ac8b856cb81246ff39c2ceaac5bd72587db68a5d260c3117599e24c38c
diff --git a/x11-apps/xdm/files/xdm-1.1.12-consolekit.patch b/x11-apps/xdm/files/xdm-1.1.12-consolekit.patch
new file mode 100644
index 000000000000..232d10d94db8
--- /dev/null
+++ b/x11-apps/xdm/files/xdm-1.1.12-consolekit.patch
@@ -0,0 +1,269 @@
+http://bugs.gentoo.org/360987
+http://projects.archlinux.org/svntogit/packages.git/plain/trunk/xdm-consolekit.patch?h=packages/xorg-xdm
+http://lists.x.org/archives/xorg-devel/2011-February/019615.html
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=615020
+---
+ configure.ac | 20 ++++++++--
+ include/dm.h | 3 ++
+ man/xdm.man | 6 +++
+ xdm/resource.c | 13 ++++++-
+ xdm/session.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 5 files changed, 140 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index d110809..db973f7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -168,15 +168,15 @@ AS_IF([test "x$with_systemdsystemunitdir" != "xno"], [
+ AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$with_systemdsystemunitdir" != "xno"])
+
+ # Check whether to enable systemd startup notification.
+-# This requires libsystemd-daemon.
++# This requires libsystemd.
+ AC_ARG_WITH([systemd-daemon], AS_HELP_STRING([--with-systemd-daemon],
+ [Add support for systemd startup notification (default is autodetected)]),
+ [USE_SYSTEMD_DAEMON=$withval], [USE_SYSTEMD_DAEMON=auto])
+ AS_IF([test "x$USE_SYSTEMD_DAEMON" != "xno"], [
+- PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon],
++ PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd],
+ [AC_DEFINE(USE_SYSTEMD_DAEMON,1,[Use systemd startup notification])],
+ [AS_IF([test "x$USE_SYSTEMD_DAEMON" = "xyes"],
+- [AC_MSG_ERROR([systemd startup notification support requested, but libsystemd-daemon not found.])]
++ [AC_MSG_ERROR([systemd startup notification support requested, but libsystemd not found.])]
+ )]
+ )
+ ])
+@@ -395,6 +395,20 @@ PKG_CHECK_MODULES(DMCP, xdmcp)
+ PKG_CHECK_MODULES(XLIB, x11)
+ PKG_CHECK_MODULES(AUTH, xau)
+
++# 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)
++
+ #
+ # Greeter
+ #
+diff --git a/include/dm.h b/include/dm.h
+index 9116d6f..27fdd71 100644
+--- a/include/dm.h
++++ b/include/dm.h
+@@ -327,6 +327,9 @@ extern char *randomFile;
+ extern char *prngdSocket;
+ extern int prngdPort;
+ # endif
++#ifdef USE_CONSOLEKIT
++extern int use_consolekit;
++#endif
+
+ extern char *greeterLib;
+ extern char *willing;
+diff --git a/man/xdm.man b/man/xdm.man
+index ef57d8c..de99d25 100644
+--- a/man/xdm.man
++++ b/man/xdm.man
+@@ -48,6 +48,8 @@ xdm \- X Display Manager with support for XDMCP, host chooser
+ ] [
+ .B \-session
+ .I session_program
++] [
++.B \-noconsolekit
+ ]
+ .SH DESCRIPTION
+ .I Xdm
+@@ -215,6 +217,10 @@ indicates the program to run as the session after the user has logged in.
+ .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/xdm/resource.c b/xdm/resource.c
+index 316ace4..725351e 100644
+--- a/xdm/resource.c
++++ b/xdm/resource.c
+@@ -65,6 +65,9 @@ char *randomDevice;
+ char *prngdSocket;
+ int prngdPort;
+ #endif
++#ifdef USE_CONSOLEKIT
++int use_consolekit;
++#endif
+
+ char *greeterLib;
+ char *willing;
+@@ -192,6 +195,10 @@ struct dmResources {
+ "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])
+@@ -377,7 +384,11 @@ XrmOptionDescRec optionTable [] = {
+ {"-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;
+diff --git a/xdm/session.c b/xdm/session.c
+index 4fd7d0a..c16978d 100644
+--- a/xdm/session.c
++++ b/xdm/session.c
+@@ -73,6 +73,11 @@ extern int key_setnet(struct key_netstarg *arg);
+ # endif
+ #endif /* USE_PAM */
+
++#ifdef USE_CONSOLEKIT
++#include <ck-connector.h>
++#include <dbus/dbus.h>
++#endif
++
+ #ifdef USE_SELINUX
+ #include <selinux/selinux.h>
+ #include <selinux/get_context_list.h>
+@@ -523,6 +528,97 @@ UnsecureDisplay (struct display *d, Display *dpy)
+ }
+ }
+
++#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)
+ {
+@@ -537,6 +633,8 @@ SessionExit (struct display *d, int status, int removeAuth)
+ }
+ #endif
+
++ closeCKSession();
++
+ /* make sure the server gets reset after the session is over */
+ if (d->serverPid >= 2 && d->resetSignal)
+ kill (d->serverPid, d->resetSignal);
+@@ -614,6 +712,10 @@ StartClient (
+ #ifdef USE_PAM
+ if (pamh) pam_open_session(pamh, 0);
+ #endif
++
++ if (!openCKSession(verify, d))
++ return 0;
++
+ switch (pid = fork ()) {
+ case 0:
+ CleanUpChild ();
+--
+2.19.2
+
diff --git a/x11-apps/xdm/files/xdm-1.1.12-make-xinerama-optional.patch b/x11-apps/xdm/files/xdm-1.1.12-make-xinerama-optional.patch
new file mode 100644
index 000000000000..bc953ff0f31c
--- /dev/null
+++ b/x11-apps/xdm/files/xdm-1.1.12-make-xinerama-optional.patch
@@ -0,0 +1,34 @@
+ configure.ac | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index db973f7..64a0e37 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -330,7 +330,13 @@ AC_SUBST(SHELL_CMD)
+
+ PKG_CHECK_MODULES(XDM, [xmu x11 xau xproto >= 7.0.17])
+
+-PKG_CHECK_EXISTS(xinerama, [
++AC_ARG_WITH(xinerama,
++ AS_HELP_STRING([--with-xinerama],
++ [Use Xinerama (default is YES if installed)]),
++ [USE_XINERAMA="$withval"],
++ PKG_CHECK_EXISTS(xinerama, [USE_XINERAMA="yes"], [USE_XINERAMA="no"]))
++
++if test "x$USE_XINERAMA" = "xyes" ; then
+ AC_DEFINE([USE_XINERAMA], 1,
+ [Define to 1 to use XINERAMA in greeter & chooser])
+ PKG_CHECK_MODULES(XINERAMA, xinerama)
+@@ -338,7 +344,7 @@ PKG_CHECK_EXISTS(xinerama, [
+ CHOOSER_LIBS="$CHOOSER_LIBS $XINERAMA_LIBS"
+ GREETER_CFLAGS="$GREETER_CFLAGS $XINERAMA_CFLAGS"
+ GREETER_LIBS="$GREETER_LIBS $XINERAMA_LIBS"
+-])
++fi
+
+ # Xft text drawing for the greeter screen
+ AC_ARG_WITH(xft,
+--
+2.19.2
+
diff --git a/x11-apps/xdm/xdm-1.1.12.ebuild b/x11-apps/xdm/xdm-1.1.12.ebuild
new file mode 100644
index 000000000000..e7d6bd756525
--- /dev/null
+++ b/x11-apps/xdm/xdm-1.1.12.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+XORG_EAUTORECONF=yes
+
+inherit multilib xorg-3 pam systemd
+
+DEFAULTVT=vt7
+
+DESCRIPTION="X.Org xdm application"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="consolekit ipv6 pam systemd truetype xinerama xpm"
+
+RDEPEND="
+ x11-apps/sessreg
+ x11-apps/xconsole
+ x11-apps/xinit
+ x11-apps/xrdb
+ x11-apps/xsm
+ x11-libs/libX11
+ x11-libs/libXaw
+ x11-libs/libXdmcp
+ x11-libs/libXmu
+ x11-libs/libXt
+ consolekit? ( sys-auth/consolekit )
+ pam? ( virtual/pam )
+ systemd? ( >=sys-apps/systemd-209 )
+ truetype? (
+ x11-libs/libXrender
+ x11-libs/libXft
+ )
+ xinerama? ( x11-libs/libXinerama )
+ xpm? ( x11-libs/libXpm )
+ elibc_glibc? ( dev-libs/libbsd )"
+DEPEND="${RDEPEND}
+ x11-base/xorg-proto
+ consolekit? ( !=sys-auth/pambase-20101024-r1 )"
+
+pkg_setup() {
+ PATCHES=(
+ "${FILESDIR}"/${P}-consolekit.patch
+ "${FILESDIR}"/${P}-make-xinerama-optional.patch
+ )
+
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable ipv6)
+ $(use_with consolekit)
+ $(use_with pam)
+ $(use_with systemd systemd-daemon)
+ $(use_with truetype xft)
+ $(use_with xinerama)
+ $(use_enable xpm xpm-logos)
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+ --with-default-vt=${DEFAULTVT}
+ --with-xdmconfigdir=/etc/X11/xdm
+ )
+}
+
+src_prepare() {
+ sed -i -e 's:^Alias=.*$:Alias=display-manager.service:' \
+ xdm.service.in || die
+
+ # Disable XDM-AUTHORIZATION-1 (bug #445662).
+ # it causes issue with libreoffice and SDL games (bug #306223).
+ sed -i -e '/authorize/a DisplayManager*authName: MIT-MAGIC-COOKIE-1' \
+ config/xdm-config.in || die
+
+ xorg-3_src_prepare
+}
+
+src_install() {
+ xorg-3_src_install
+
+ exeinto /usr/$(get_libdir)/X11/xdm
+ doexe "${FILESDIR}"/Xsession
+
+ use pam && pamd_mimic system-local-login xdm auth account session
+
+ # Keep /var/lib/xdm. This is where authfiles are stored. See #286350.
+ keepdir /var/lib/xdm
+}