From b17936a7710ffb5562a35f71db78f532879175b1 Mon Sep 17 00:00:00 2001 From: ayhanyalcinsoy Date: Thu, 9 Mar 2017 16:02:46 +0300 Subject: [PATCH] =?UTF-8?q?xdm:moved=20into=20main=20for=20yal=C4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- x11/misc/xdm/actions.py | 39 +++ x11/misc/xdm/comar/service.py | 38 +++ ...xdm-1.0.5-sessreg-utmp-fix-bug177890.patch | 8 + .../fedora/xdm-1.1.10-add-audit-event.patch | 109 +++++++++ .../xdm/files/fedora/xdm-1.1.10-libdl.patch | 10 + x11/misc/xdm/files/no-xconsole.patch | 17 ++ x11/misc/xdm/files/resources.patch | 10 + x11/misc/xdm/files/start-dm.sh | 79 ++++++ .../files/xdm-1.1.11-arc4random-include.patch | 18 ++ .../xdm/files/xdm-1.1.11-cve-2013-2179.patch | 41 ++++ .../xdm-1.1.11-setproctitle-include.patch | 37 +++ ...dm-add-definition-for-libbsd-headers.patch | 37 +++ x11/misc/xdm/files/xdm-consolekit.patch | 230 ++++++++++++++++++ x11/misc/xdm/files/xdm.conf.d | 5 + x11/misc/xdm/files/xdm.desktop | 9 + x11/misc/xdm/files/xdm.pam.d | 13 + x11/misc/xdm/files/xorg-safe-fbdev.conf | 18 ++ x11/misc/xdm/files/xorg-safe-vesa.conf | 18 ++ x11/misc/xdm/files/xsession.patch | 53 ++++ x11/misc/xdm/pspec.xml | 96 ++++++++ x11/misc/xdm/translations.xml | 8 + 21 files changed, 893 insertions(+) create mode 100644 x11/misc/xdm/actions.py create mode 100755 x11/misc/xdm/comar/service.py create mode 100644 x11/misc/xdm/files/fedora/xdm-1.0.5-sessreg-utmp-fix-bug177890.patch create mode 100644 x11/misc/xdm/files/fedora/xdm-1.1.10-add-audit-event.patch create mode 100644 x11/misc/xdm/files/fedora/xdm-1.1.10-libdl.patch create mode 100755 x11/misc/xdm/files/no-xconsole.patch create mode 100755 x11/misc/xdm/files/resources.patch create mode 100755 x11/misc/xdm/files/start-dm.sh create mode 100755 x11/misc/xdm/files/xdm-1.1.11-arc4random-include.patch create mode 100755 x11/misc/xdm/files/xdm-1.1.11-cve-2013-2179.patch create mode 100755 x11/misc/xdm/files/xdm-1.1.11-setproctitle-include.patch create mode 100644 x11/misc/xdm/files/xdm-add-definition-for-libbsd-headers.patch create mode 100755 x11/misc/xdm/files/xdm-consolekit.patch create mode 100755 x11/misc/xdm/files/xdm.conf.d create mode 100755 x11/misc/xdm/files/xdm.desktop create mode 100755 x11/misc/xdm/files/xdm.pam.d create mode 100755 x11/misc/xdm/files/xorg-safe-fbdev.conf create mode 100755 x11/misc/xdm/files/xorg-safe-vesa.conf create mode 100755 x11/misc/xdm/files/xsession.patch create mode 100644 x11/misc/xdm/pspec.xml create mode 100644 x11/misc/xdm/translations.xml diff --git a/x11/misc/xdm/actions.py b/x11/misc/xdm/actions.py new file mode 100644 index 0000000000..02b788d616 --- /dev/null +++ b/x11/misc/xdm/actions.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# +# Licensed under the GNU General Public License, version 3. +# See the file http://www.gnu.org/copyleft/gpl.txt. + +from pisi.actionsapi import get +from pisi.actionsapi import autotools +from pisi.actionsapi import pisitools + +def setup(): + autotools.autoreconf("-vif") + + autotools.configure("--disable-static \ + --enable-unix-transport \ + --enable-tcp-transport \ + --enable-local-transport \ + --enable-secure-rpc \ + --enable-xpm-logos \ + --enable-xdm-auth \ + --with-pam \ + --with-libaudit \ + --with-xdmconfigdir=/etc/X11/xdm \ + --with-default-vt=vt7 \ + --with-config-type=ws \ + --with-xft \ + --with-pixmapdir=/usr/share/X11/xdm/pixmaps \ + ") + + pisitools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ") + +def build(): + autotools.make() + +def install(): + autotools.rawInstall("DESTDIR=%s" % get.installDIR()) + + pisitools.dodir("/var/lib/xdm") + + pisitools.dodoc("AUTHORS", "COPYING", "README") diff --git a/x11/misc/xdm/comar/service.py b/x11/misc/xdm/comar/service.py new file mode 100755 index 0000000000..196ab55287 --- /dev/null +++ b/x11/misc/xdm/comar/service.py @@ -0,0 +1,38 @@ +from comar.service import * + +serviceType = "local" +serviceDesc = _({ + "en": "Display Manager", + "tr": "Görüntü Yöneticisi", +}) +serviceDefault = "on" + +pidFile = "/run/dm.pid" + +@synchronized +def start(boot=False): + if status(): + return + + #startDependencies("acpid") + + startService(command="/usr/bin/start-dm", + args="--boot" if boot else None, + detach=True, + pidfile=pidFile, + makepid=True, + donotify=True) + +@synchronized +def stop(): + stopService(pidfile=pidFile, + donotify=True) + +def status(): + return isServiceRunning(pidFile) + +def ready(): + from pardus.sysutils import get_kernel_option + + if is_on() == "on" and "off" not in get_kernel_option("xorg"): + start(boot=True) diff --git a/x11/misc/xdm/files/fedora/xdm-1.0.5-sessreg-utmp-fix-bug177890.patch b/x11/misc/xdm/files/fedora/xdm-1.0.5-sessreg-utmp-fix-bug177890.patch new file mode 100644 index 0000000000..8bf48e4b31 --- /dev/null +++ b/x11/misc/xdm/files/fedora/xdm-1.0.5-sessreg-utmp-fix-bug177890.patch @@ -0,0 +1,8 @@ +--- config/GiveConsole.sessreg-utmp-fix-bug177890 2006-07-24 04:20:10.000000000 -0400 ++++ config/GiveConsole 2006-07-24 04:21:16.000000000 -0400 +@@ -8,3 +8,5 @@ + # causing serious grief. + # + chown $USER /dev/console ++exec /usr/bin/sessreg -a -w "/var/log/wtmp" -u "/var/run/utmp" \ ++ -x "/etc/X11/xdm/Xservers" -l $DISPLAY -h "" $USER diff --git a/x11/misc/xdm/files/fedora/xdm-1.1.10-add-audit-event.patch b/x11/misc/xdm/files/fedora/xdm-1.1.10-add-audit-event.patch new file mode 100644 index 0000000000..12a8ea880e --- /dev/null +++ b/x11/misc/xdm/files/fedora/xdm-1.1.10-add-audit-event.patch @@ -0,0 +1,109 @@ +diff -up xdm-1.1.11/config.h.in.add-audit-events xdm-1.1.11/config.h.in +--- xdm-1.1.11/config.h.in.add-audit-events 2011-09-25 09:42:16.000000000 +0200 ++++ xdm-1.1.11/config.h.in 2011-09-26 17:44:21.796495208 +0200 +@@ -193,6 +193,9 @@ + /* Use PAM for authentication */ + #undef USE_PAM + ++/* Add linux audit support */ ++#undef HAVE_LIBAUDIT ++ + /* Use Security-Enhanced Linux (SELinux) support */ + #undef USE_SELINUX + +diff -up xdm-1.1.11/configure.ac.add-audit-events xdm-1.1.11/configure.ac +--- xdm-1.1.11/configure.ac.add-audit-events 2011-09-25 09:41:19.000000000 +0200 ++++ xdm-1.1.11/configure.ac 2011-09-26 17:43:30.616557363 +0200 +@@ -145,6 +145,29 @@ if test "x$USE_SELINUX" != "xno" ; then + ) + fi + ++AC_ARG_WITH(libaudit, ++ [ --with-libaudit=[auto/yes/no] Add Linux audit support [default=auto]],, ++ with_libaudit=auto) ++ ++# Check for Linux auditing API ++# ++# libaudit detection ++if test x$with_libaudit = xno ; then ++ have_libaudit=no; ++else ++ # See if we have audit daemon library ++ AC_CHECK_LIB(audit, audit_log_user_message, ++ have_libaudit=yes, have_libaudit=no) ++fi ++ ++AM_CONDITIONAL(HAVE_LIBAUDIT, test x$have_libaudit = xyes) ++ ++if test x$have_libaudit = xyes ; then ++ XDMGREET_LIBS="$XDMGREET_LIBS -laudit" ++ AC_DEFINE(HAVE_LIBAUDIT,1,[linux audit support]) ++fi ++ ++ + # Check whether to install systemd unit files, as suggested in daemon(7). + AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-systemdsystemunitdir=DIR], + [Directory for systemd service files (default from the System and Service Manager)]),, +diff -up xdm-1.1.11/greeter/greet.c.add-audit-events xdm-1.1.11/greeter/greet.c +--- xdm-1.1.11/greeter/greet.c.add-audit-events 2011-09-25 09:35:47.000000000 +0200 ++++ xdm-1.1.11/greeter/greet.c 2011-09-26 17:46:11.996361376 +0200 +@@ -86,6 +86,13 @@ from The Open Group. + # endif + #endif + ++#ifdef HAVE_LIBAUDIT ++#include ++#include ++#else ++#define log_to_audit_system(l,h,s) do { ; } while (0) ++#endif ++ + #include + + #if defined(SECURE_RPC) && defined(sun) +@@ -415,6 +422,29 @@ FailedLogin (struct display *d, const ch + DrawFail (login); + } + ++#ifdef USE_PAM ++#ifdef HAVE_LIBAUDIT ++static void ++log_to_audit_system(const pam_handle_t *pamhp, int success) ++{ ++ struct passwd *pw = NULL; ++ char *hostname = NULL, *tty = NULL, *login=NULL; ++ int audit_fd; ++ ++ audit_fd = audit_open(); ++ pam_get_item(pamhp, PAM_RHOST, &hostname); ++ pam_get_item(pamhp, PAM_TTY, &tty); ++ pam_get_item(pamhp, PAM_USER, &login); ++ if (login) ++ pw = getpwnam(login); ++ audit_log_acct_message(audit_fd, AUDIT_USER_LOGIN, ++ NULL, "login", login ? login : "(unknown)", ++ pw ? pw->pw_uid : -1, hostname, NULL, tty, success); ++ close(audit_fd); ++} ++#endif ++#endif ++ + _X_EXPORT + greet_user_rtn GreetUser( + struct display *d, +@@ -600,6 +630,7 @@ greet_user_rtn GreetUser( + if ((pam_error == PAM_SUCCESS) && (Verify (d, greet, verify))) { + SetPrompt (login, 1, "Login Successful", LOGIN_TEXT_INFO, False); + SetValue (login, 1, NULL); ++ log_to_audit_system(*pamhp, 1); + break; + } else { + /* Try to fill in username for failed login error log */ +@@ -611,6 +642,7 @@ greet_user_rtn GreetUser( + (void *) &username)); + } + FailedLogin (d, username); ++ log_to_audit_system(*pamhp, 0); + RUN_AND_CHECK_PAM_ERROR(pam_end, + (*pamhp, pam_error)); + } diff --git a/x11/misc/xdm/files/fedora/xdm-1.1.10-libdl.patch b/x11/misc/xdm/files/fedora/xdm-1.1.10-libdl.patch new file mode 100644 index 0000000000..1aa672f20d --- /dev/null +++ b/x11/misc/xdm/files/fedora/xdm-1.1.10-libdl.patch @@ -0,0 +1,10 @@ +--- configure.ac.jx 2010-04-09 21:49:03.000000000 -0400 ++++ configure.ac 2011-04-01 13:24:14.000000000 -0400 +@@ -454,6 +454,7 @@ + AM_CONDITIONAL(HAS_XDM_AUTH, test x$xdmauth = xyes -a x$xdmauth_enable != xno) + + AC_SEARCH_LIBS(crypt, crypt) ++AC_SEARCH_LIBS([dlopen], [dl]) + + AC_SUBST(XDM_CFLAGS) + AC_SUBST(XDM_LIBS) diff --git a/x11/misc/xdm/files/no-xconsole.patch b/x11/misc/xdm/files/no-xconsole.patch new file mode 100755 index 0000000000..6a7c34284f --- /dev/null +++ b/x11/misc/xdm/files/no-xconsole.patch @@ -0,0 +1,17 @@ +Index: xdm-1.1.8_20090308/config/xdm-config.cpp +=================================================================== +--- xdm-1.1.8_20090308.orig/config/xdm-config.cpp ++++ xdm-1.1.8_20090308/config/xdm-config.cpp +@@ -30,9 +30,9 @@ DisplayManager*session: XDMSCRIPTDIR/Xs + DisplayManager*reset: XDMSCRIPTDIR/Xreset + DisplayManager*authComplain: true + ! The following three resources set up display :0 as the console. +-DisplayManager._0.setup: XDMSCRIPTDIR/Xsetup_0 +-DisplayManager._0.startup: XDMSCRIPTDIR/GiveConsole +-DisplayManager._0.reset: XDMSCRIPTDIR/TakeConsole ++!DisplayManager._0.setup: XDMSCRIPTDIR/Xsetup_0 ++!DisplayManager._0.startup: XDMSCRIPTDIR/GiveConsole ++!DisplayManager._0.reset: XDMSCRIPTDIR/TakeConsole + #ifdef XPM + DisplayManager*loginmoveInterval: 10 + #endif /* XPM */ diff --git a/x11/misc/xdm/files/resources.patch b/x11/misc/xdm/files/resources.patch new file mode 100755 index 0000000000..2f99d204e6 --- /dev/null +++ b/x11/misc/xdm/files/resources.patch @@ -0,0 +1,10 @@ +Index: xdm-1.1.9/config/Xresources.cpp +=================================================================== +--- xdm-1.1.9.orig/config/Xresources.cpp ++++ xdm-1.1.9/config/Xresources.cpp +@@ -86,3 +86,5 @@ Chooser*label.font: *-new century schoo + Chooser*label.label: XDMCP Host Menu from CLIENTHOST + Chooser*list.font: -*-*-medium-r-normal-*-*-230-*-*-c-*-iso8859-1 + Chooser*Command.font: *-new century schoolbook-bold-r-normal-*-180-* ++ ++XHASHinclude "/etc/X11/Xresources" diff --git a/x11/misc/xdm/files/start-dm.sh b/x11/misc/xdm/files/start-dm.sh new file mode 100755 index 0000000000..21a0861c12 --- /dev/null +++ b/x11/misc/xdm/files/start-dm.sh @@ -0,0 +1,79 @@ +#!/bin/sh + +read_config() { + FILE=$1 + KEY=$2 + LINE=$(grep "^$KEY=" $FILE) + VALUE=${LINE#$KEY=} +} + +DISPLAY_MANAGER=xdm +XCURSOR_THEME= +PLYMOUTH_TRANSITION=false + +test -r /etc/default/xdm && . /etc/default/xdm +test -r /etc/conf.d/xdm && . /etc/conf.d/xdm + +DM_PATH= +DESKTOP_FILE=/usr/share/display-managers/$DISPLAY_MANAGER.desktop + +if [ -f $DESKTOP_FILE ]; then + read_config $DESKTOP_FILE Exec + DM_PATH=$VALUE + read_config $DESKTOP_FILE X-Pardus-XCursorTheme + test -n "$VALUE" && XCURSOR_THEME=$VALUE + read_config $DESKTOP_FILE X-Pardus-PlymouthTransition + test -n "$VALUE" && PLYMOUTH_TRANSITION=$VALUE +fi + +test -x "$DM_PATH" || DM_PATH=/usr/bin/xdm + +PATH=/sbin:/usr/sbin:/bin:/usr/bin + +test -f /etc/env.d/03locale && . /etc/env.d/03locale + +export LC_ALL PATH XCURSOR_THEME + +if [ "x$1" = "x--boot" ]; then + for x in `grep -o -e "xorg=\w*" /proc/cmdline`; do + case "$x" in + xorg=safe) + MESA_LIBGL=/usr/lib/mesa/libGL.so.1.2.0 + if [ "$(readlink /etc/alternatives/libGL)" != "$MESA_LIBGL" ]; then + /usr/sbin/alternatives --set libGL /usr/lib/mesa/libGL.so.1.2.0 + /sbin/ldconfig -X + fi + + DRIVER=vesa + test -c /dev/fb0 && DRIVER=fbdev + export XORGCONFIG=/usr/share/X11/xorg-safe-$DRIVER.conf + ;; + xorg=probe) + test -f /etc/X11/xorg.conf && mv -f /etc/X11/xorg.conf /etc/X11/xorg.conf.$(date +%Y%m%d) + ;; + esac + done +fi + +# Trigger events against a locale change. This is needed for +# determining the default keymap. +udevadm trigger --property-match=ID_INPUT_KEYBOARD=1 + +# Start first boot wizard if needed +if test -f /etc/yali/yali.conf -a -x /usr/bin/start-yali && \ + grep -e "^installation *= *firstboot" /etc/yali/yali.conf; then + /usr/bin/start-yali + + # First boot wizard removes itself after the last screen. If it + # still exists at this time, this would mean a reboot or shutdown + # requested by the user. In this case, we will not start the + # display manager. + test -f /usr/bin/start-yali && exit 0 + sleep 1 +fi + +if [ "$PLYMOUTH_TRANSITION" != "true" ]; then + test -x /bin/plymouth && /bin/plymouth --ping && /bin/plymouth quit +fi + +exec $DM_PATH -nodaemon diff --git a/x11/misc/xdm/files/xdm-1.1.11-arc4random-include.patch b/x11/misc/xdm/files/xdm-1.1.11-arc4random-include.patch new file mode 100755 index 0000000000..db948094b7 --- /dev/null +++ b/x11/misc/xdm/files/xdm-1.1.11-arc4random-include.patch @@ -0,0 +1,18 @@ +diff -ur a/xdm/genauth.c b/xdm/genauth.c +--- a/xdm/genauth.c 2011-09-25 09:35:47.000000000 +0200 ++++ b/xdm/genauth.c 2014-01-06 16:28:09.664060603 +0100 +@@ -40,6 +40,14 @@ + + #include + ++#ifdef HAVE_ARC4RANDOM ++# ifdef __linux__ ++# include ++# else ++# include ++# endif ++#endif ++ + #include + #define Time_t time_t + diff --git a/x11/misc/xdm/files/xdm-1.1.11-cve-2013-2179.patch b/x11/misc/xdm/files/xdm-1.1.11-cve-2013-2179.patch new file mode 100755 index 0000000000..34ae7ceb3c --- /dev/null +++ b/x11/misc/xdm/files/xdm-1.1.11-cve-2013-2179.patch @@ -0,0 +1,41 @@ +From 8d1eb5c74413e4c9a21f689fc106949b121c0117 Mon Sep 17 00:00:00 2001 +From: mancha +Date: Wed, 22 May 2013 14:20:26 +0000 +Subject: Handle NULL returns from glibc 2.17+ crypt(). + +Starting with glibc 2.17 (eglibc 2.17), crypt() fails with EINVAL +(w/ NULL return) if the salt violates specifications. Additionally, +on FIPS-140 enabled Linux systems, DES/MD5-encrypted passwords +passed to crypt() fail with EPERM (w/ NULL return). + +If using glibc's crypt(), check return value to avoid a possible +NULL pointer dereference. + +Reviewed-by: Matthieu Herrb +Signed-off-by: Alan Coopersmith +--- +diff --git a/greeter/verify.c b/greeter/verify.c +index db3cb7d..b009e2b 100644 +--- a/greeter/verify.c ++++ b/greeter/verify.c +@@ -329,6 +329,7 @@ Verify (struct display *d, struct greet_info *greet, struct verify_info *verify) + struct spwd *sp; + # endif + char *user_pass = NULL; ++ char *crypted_pass = NULL; + # endif + # ifdef __OpenBSD__ + char *s; +@@ -464,7 +465,9 @@ Verify (struct display *d, struct greet_info *greet, struct verify_info *verify) + # if defined(ultrix) || defined(__ultrix__) + if (authenticate_user(p, greet->password, NULL) < 0) + # else +- if (strcmp (crypt (greet->password, user_pass), user_pass)) ++ crypted_pass = crypt (greet->password, user_pass); ++ if ((crypted_pass == NULL) ++ || (strcmp (crypted_pass, user_pass))) + # endif + { + if(!greet->allow_null_passwd || strlen(p->pw_passwd) > 0) { +-- +cgit v0.9.0.2-2-gbebe diff --git a/x11/misc/xdm/files/xdm-1.1.11-setproctitle-include.patch b/x11/misc/xdm/files/xdm-1.1.11-setproctitle-include.patch new file mode 100755 index 0000000000..0a3f32bbea --- /dev/null +++ b/x11/misc/xdm/files/xdm-1.1.11-setproctitle-include.patch @@ -0,0 +1,37 @@ +diff -ur a/xdm/choose.c b/xdm/choose.c +--- a/xdm/choose.c 2011-09-25 09:35:47.000000000 +0200 ++++ b/xdm/choose.c 2014-01-06 16:33:09.628065364 +0100 +@@ -54,6 +54,14 @@ + # include + # endif + ++# ifdef HAVE_SETPROCTITLE ++# ifdef __linux__ ++# include ++# else ++# include ++# endif ++# endif ++ + # include + # define Time_t time_t + +diff -ur a/xdm/session.c b/xdm/session.c +--- a/xdm/session.c 2011-09-25 09:35:47.000000000 +0200 ++++ b/xdm/session.c 2014-01-06 16:40:57.508072789 +0100 +@@ -54,6 +54,15 @@ + # include + #endif + ++# ifdef HAVE_SETPROCTITLE ++# include ++# ifdef __linux__ ++# include ++# else ++# include ++# endif ++# endif ++ + #ifndef USE_PAM /* PAM modules should handle these */ + # ifdef SECURE_RPC + # include diff --git a/x11/misc/xdm/files/xdm-add-definition-for-libbsd-headers.patch b/x11/misc/xdm/files/xdm-add-definition-for-libbsd-headers.patch new file mode 100644 index 0000000000..0a3f32bbea --- /dev/null +++ b/x11/misc/xdm/files/xdm-add-definition-for-libbsd-headers.patch @@ -0,0 +1,37 @@ +diff -ur a/xdm/choose.c b/xdm/choose.c +--- a/xdm/choose.c 2011-09-25 09:35:47.000000000 +0200 ++++ b/xdm/choose.c 2014-01-06 16:33:09.628065364 +0100 +@@ -54,6 +54,14 @@ + # include + # endif + ++# ifdef HAVE_SETPROCTITLE ++# ifdef __linux__ ++# include ++# else ++# include ++# endif ++# endif ++ + # include + # define Time_t time_t + +diff -ur a/xdm/session.c b/xdm/session.c +--- a/xdm/session.c 2011-09-25 09:35:47.000000000 +0200 ++++ b/xdm/session.c 2014-01-06 16:40:57.508072789 +0100 +@@ -54,6 +54,15 @@ + # include + #endif + ++# ifdef HAVE_SETPROCTITLE ++# include ++# ifdef __linux__ ++# include ++# else ++# include ++# endif ++# endif ++ + #ifndef USE_PAM /* PAM modules should handle these */ + # ifdef SECURE_RPC + # include diff --git a/x11/misc/xdm/files/xdm-consolekit.patch b/x11/misc/xdm/files/xdm-consolekit.patch new file mode 100755 index 0000000000..fbacd36fc0 --- /dev/null +++ b/x11/misc/xdm/files/xdm-consolekit.patch @@ -0,0 +1,230 @@ +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 + +--- 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 ++#include ++#endif ++ + #ifdef __SCO__ + #include + #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/x11/misc/xdm/files/xdm.conf.d b/x11/misc/xdm/files/xdm.conf.d new file mode 100755 index 0000000000..ce543de100 --- /dev/null +++ b/x11/misc/xdm/files/xdm.conf.d @@ -0,0 +1,5 @@ +# Preferred display manager +DISPLAY_MANAGER="kdm" + +# Cursor theme +#XCURSOR_THEME="" diff --git a/x11/misc/xdm/files/xdm.desktop b/x11/misc/xdm/files/xdm.desktop new file mode 100755 index 0000000000..8be6455874 --- /dev/null +++ b/x11/misc/xdm/files/xdm.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Exec=/usr/bin/xdm +Icon=xorg +Type=Application +X-Pardus-XCursorTheme=Jimmac + +Name=XDM +GenericName=X Login Manager +GenericName[tr]=X Giriş Yöneticisi diff --git a/x11/misc/xdm/files/xdm.pam.d b/x11/misc/xdm/files/xdm.pam.d new file mode 100755 index 0000000000..dd8789db5a --- /dev/null +++ b/x11/misc/xdm/files/xdm.pam.d @@ -0,0 +1,13 @@ +#%PAM-1.0 + +auth include system-auth +auth required pam_nologin.so + +account include system-auth + +password include system-auth + +session include system-auth + +session optional pam_console.so +session optional pam_polkit_console.so diff --git a/x11/misc/xdm/files/xorg-safe-fbdev.conf b/x11/misc/xdm/files/xorg-safe-fbdev.conf new file mode 100755 index 0000000000..701218ca04 --- /dev/null +++ b/x11/misc/xdm/files/xorg-safe-fbdev.conf @@ -0,0 +1,18 @@ +Section "Module" + SubSection "extmod" + Option "omit xfree86-dga" "true" + EndSubSection +EndSection + +Section "ServerFlags" + Option "BlankTime" "0" + Option "OffTime" "0" + Option "SuspendTime" "0" + Option "AllowMouseOpenFail" "true" + Option "StandbyTime" "0" +EndSection + +Section "Device" + Identifier "VideoCard" + Driver "fbdev" +EndSection diff --git a/x11/misc/xdm/files/xorg-safe-vesa.conf b/x11/misc/xdm/files/xorg-safe-vesa.conf new file mode 100755 index 0000000000..e8731d982e --- /dev/null +++ b/x11/misc/xdm/files/xorg-safe-vesa.conf @@ -0,0 +1,18 @@ +Section "Module" + SubSection "extmod" + Option "omit xfree86-dga" "true" + EndSubSection +EndSection + +Section "ServerFlags" + Option "BlankTime" "0" + Option "OffTime" "0" + Option "SuspendTime" "0" + Option "AllowMouseOpenFail" "true" + Option "StandbyTime" "0" +EndSection + +Section "Device" + Identifier "VideoCard" + Driver "vesa" +EndSection diff --git a/x11/misc/xdm/files/xsession.patch b/x11/misc/xdm/files/xsession.patch new file mode 100755 index 0000000000..17dfaff145 --- /dev/null +++ b/x11/misc/xdm/files/xsession.patch @@ -0,0 +1,53 @@ +Index: xdm-1.1.8_20090308/config/Xsession.cpp +=================================================================== +--- xdm-1.1.8_20090308.orig/config/Xsession.cpp ++++ xdm-1.1.8_20090308/config/Xsession.cpp +@@ -41,47 +41,4 @@ XCOMM done + #endif + fi + +-case $# in +-1) +- case $1 in +- failsafe) +- exec BINDIR/xterm -geometry 80x24-0-0 +- ;; +- esac +-esac +- +-XCOMM The startup script is not intended to have arguments. +- +-startup=$HOME/.xsession +-resources=$HOME/.Xresources +- +-if [ -s "$startup" ]; then +- if [ -x "$startup" ]; then +- exec "$startup" +- else +- exec /bin/sh "$startup" +- fi +-else +- if [ -r "$resources" ]; then +- BINDIR/xrdb -load "$resources" +- fi +-#if defined(__SCO__) || defined(__UNIXWARE__) +- [ -r /etc/default/xdesktops ] && { +- . /etc/default/xdesktops +- } +- +- [ -r /etc/default/xdm ] && { +- . /etc/default/xdm +- } +- +- XCOMM Allow the user to over-ride the system default desktop +- [ -r $HOME/.xdmdesktop ] && { +- . $HOME/.xdmdesktop +- } +- +- [ -n "$XDESKTOP" ] && { +- exec `eval $XDESKTOP` +- } +-#endif +- exec BINDIR/xsm +-fi ++. /usr/lib/X11/xinit/Xsession diff --git a/x11/misc/xdm/pspec.xml b/x11/misc/xdm/pspec.xml new file mode 100644 index 0000000000..d31e5cbf0d --- /dev/null +++ b/x11/misc/xdm/pspec.xml @@ -0,0 +1,96 @@ + + + + + xdm + http://www.x.org + + PisiLinux Community + admins@pisilinux.org + + MIT + xorg + app:gui + X Display Manager + X Display Manager provides a login screen, session management, and support for XDMCP. + mirrors://xorg/individual/app/xdm-1.1.11.tar.bz2 + + libXt-devel + libICE-devel + libSM-devel + libX11-devel + libXaw-devel + libXft-devel + libXmu-devel + libXpm-devel + libXext-devel + libXinerama-devel + util-macros + pam-devel + xtrans + audit-devel + libbsd-devel + + + xsession.patch + no-xconsole.patch + resources.patch + xdm-1.1.11-arc4random-include.patch + xdm-1.1.11-cve-2013-2179.patch + xdm-1.1.11-setproctitle-include.patch + xdm-consolekit.patch + + + + + xdm + + pam + libX11 + libXau + libXdmcp + libXt + libbsd + libXft + libXmu + libXpm + libXaw + libXext + libXinerama + xinit + ConsoleKit + dbus + + + /etc + /usr/bin + /usr/lib/X11/xdm + /usr/share/X11 + /usr/share/display-managers + /var/lib/xdm + /usr/share/doc + /usr/share/man + + + + xdm.pam.d + start-dm.sh + xdm.desktop + xorg-safe-fbdev.conf + xorg-safe-vesa.conf + + + System.Service + + + + + + 2017-03-09 + 1.1.11 + First release + Ayhan Yalçınsoy + ayhanyalcinsoy@pisilinux.org + + + diff --git a/x11/misc/xdm/translations.xml b/x11/misc/xdm/translations.xml new file mode 100644 index 0000000000..67eca01035 --- /dev/null +++ b/x11/misc/xdm/translations.xml @@ -0,0 +1,8 @@ + + + + xdm + X Görüntü Yöneticisi + X Görüntü Yöneticisi, giriş ekranı, oturum yönetimi ve XDMCP desteği sağlar. + +