From 0a60c1edee9edea4aff85647d3e9ac04375f2510e492844492d4f5e0f877fe9b Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Fri, 4 Sep 2020 10:55:01 +0000 Subject: [PATCH] - cleanup * get rid of xdm-fallbacks.tar.bz2, which wasn't used any longer since SUSE 12.1 * no longer support systmed based OSes like SUSE < 12.1 and sle11; removed therefore also xdm-consolekit.diff * no longer support sle11 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xdm?expand=0&rev=209 --- xdm-consolekit.diff | 241 ------------------------------------------ xdm-fallbacks.tar.bz2 | 3 - xdm.changes | 10 ++ xdm.spec | 76 +------------ 4 files changed, 13 insertions(+), 317 deletions(-) delete mode 100644 xdm-consolekit.diff delete mode 100644 xdm-fallbacks.tar.bz2 diff --git a/xdm-consolekit.diff b/xdm-consolekit.diff deleted file mode 100644 index db8226c..0000000 --- a/xdm-consolekit.diff +++ /dev/null @@ -1,241 +0,0 @@ ---- - dm.h | 3 + - resource.c | 13 +++++++ - session.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - xdm.man.cpp | 6 +++ - configure.ac | 14 ++++++++ - 5 files changed, 135 insertions(+), 1 deletion(-) - -Index: xdm-1.1.10/session.c -=================================================================== ---- xdm-1.1.10.orig/session.c -+++ xdm-1.1.10/xdm/session.c -@@ -67,6 +67,11 @@ extern int key_setnet(struct key_netstar - # endif - #endif /* USE_PAM */ - -+#ifdef USE_CONSOLEKIT -+#include -+#include -+#endif -+ - #ifdef __SCO__ - # include - #endif -@@ -514,6 +519,97 @@ UnsecureDisplay (struct display *d, Disp - } - } - -+#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) - { -@@ -528,6 +624,8 @@ SessionExit (struct display *d, int stat - } - #endif - -+ closeCKSession(); -+ - /* make sure the server gets reset after the session is over */ - if (d->serverPid >= 2 && d->resetSignal) - kill (d->serverPid, d->resetSignal); -@@ -610,6 +708,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 (); -Index: xdm-1.1.10/dm.h -=================================================================== ---- xdm-1.1.10.orig/dm.h -+++ xdm-1.1.10/include/dm.h -@@ -323,6 +323,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; -Index: xdm-1.1.10/resource.c -=================================================================== ---- xdm-1.1.10.orig/resource.c -+++ xdm-1.1.10/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; -@@ -196,6 +199,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]) -@@ -378,7 +385,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; -Index: xdm-1.1.10/xdm.man.cpp -=================================================================== ---- xdm-1.1.10.orig/xdm.man.cpp -+++ xdm-1.1.10/man/xdm.man -@@ -48,6 +48,8 @@ xdm \- X Display Manager with support fo - ] [ - .B \-session - .I session_program -+] [ -+.B \-noconsolekit - ] - .SH DESCRIPTION - .I Xdm -@@ -215,6 +217,10 @@ indicates the program to run as the sess - .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 ---- xdm-1.1.11/configure.ac.orig 2014-07-18 16:22:30.057882318 +0200 -+++ xdm-1.1.11/configure.ac 2014-07-18 16:26:55.415254913 +0200 -@@ -391,6 +391,20 @@ - XDMGREET_CFLAGS="$XDMGREET_CFLAGS $XDM_TOOLKIT_CFLAGS $DMCP_CFLAGS $XLIB_CFLAGS $GREETER_CFLAGS $AUTH_CFLAGS" - XDMGREET_LIBS="$XDMGREET_LIBS $XDM_TOOLKIT_LIBS $DMCP_LIBS $GREETER_LIBS" - -+# 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" -+ XDM_LIBS="$XDM_LIBS $CK_CONNECTOR_LIBS" -+ fi -+fi -+dnl AM_CONDITIONAL(USE_CONSOLEKIT, test$USE_CONSOLEKIT = xyes) -+ - # - # XDM - # diff --git a/xdm-fallbacks.tar.bz2 b/xdm-fallbacks.tar.bz2 deleted file mode 100644 index 331593e..0000000 --- a/xdm-fallbacks.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:29ee58cb0c7923f7390e6e77e8fafab1e5e0c77ce7013680617a74403dbe66e4 -size 1050 diff --git a/xdm.changes b/xdm.changes index facc457..3fc46bc 100644 --- a/xdm.changes +++ b/xdm.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Fri Sep 4 10:29:39 UTC 2020 - Stefan Dirsch + +- cleanup + * get rid of xdm-fallbacks.tar.bz2, which wasn't used any longer + since SUSE 12.1 + * no longer support systmed based OSes like SUSE < 12.1 and sle11; + removed therefore also xdm-consolekit.diff + * no longer support sle11 + ------------------------------------------------------------------- Fri Aug 28 10:22:12 UTC 2020 - Dominique Leuenberger diff --git a/xdm.spec b/xdm.spec index d33e38f..701a3f6 100644 --- a/xdm.spec +++ b/xdm.spec @@ -22,19 +22,6 @@ %endif %define _dminitdir /usr/lib/X11/displaymanagers -%if 0%{?suse_version} > 1230 -%define with_systemd 1 -%else -%define with_systemd 0 -%endif -%if 0%{?suse_version} < 01210 -%define dm_fallbacks 1 -%else -%define dm_fallbacks 0 -%endif -%if !%with_systemd -%define _unitdir %{_prefix}/lib/systemd/system -%endif Name: xdm Version: 1.1.12 Release: 0 @@ -45,7 +32,6 @@ URL: http://xorg.freedesktop.org/ Source0: http://xorg.freedesktop.org/releases/individual/app/%{name}-%{version}.tar.bz2 Source1: xdm.tar.bz2 Source2: HOWTO.xdm -Source3: xdm-fallbacks.tar.bz2 Source4: display-manager.service Source5: xsession.desktop Patch1: xdm-tolerant-hostname-changes.diff @@ -71,14 +57,9 @@ BuildRequires: pkgconfig(xtrans) %if 0%{?suse_version} > 1320 BuildRequires: firewall-macros %endif +Requires: %fillup_prereq Requires: /sbin/pidof Requires: /sbin/startproc -%if 0%{?with_systemd} -Requires: %fillup_prereq -%endif -%if 0%{?suse_version} < 1315 -Requires: insserv-compat -%endif Requires: logrotate Requires: sessreg Requires: xconsole @@ -91,20 +72,12 @@ Requires: xsetroot Recommends: dbus-1-x11 # This was part of the xorg-x11 package up to version 7.6 Conflicts: xorg-x11 <= 7.6 -%if !%with_systemd -Patch0: xdm-consolekit.diff -%endif %if 0%{?suse_version} >= 01140 && 0%{?suse_version} < 1320 # Needed to create the man page symlink to init.d BuildRequires: aaa_base-extras %endif -%if !%with_systemd -BuildRequires: ConsoleKit-devel -Requires: ConsoleKit -%else BuildRequires: systemd-rpm-macros %{?systemd_requires} -%endif %if 0%{?suse_version} > 1320 Requires: xterm-bin %else @@ -129,9 +102,6 @@ the system wide DM default set in %{_sysconfdir}/sysconfig/displaymanager. %prep %setup -q cp %{SOURCE2} . -%if !%with_systemd -%patch0 -p1 -%endif pushd xdm %patch1 -p1 popd @@ -179,9 +149,6 @@ rm -f usr/lib/X11/display-manager.orig %{buildroot}$(dirname %{_fillupdir}) %endif -%if %dm_fallbacks -tar xf %{SOURCE3} -%endif %ifarch s390 s390x sed -i -e "s+DISPLAYMANAGER_REMOTE_ACCESS=.*+DISPLAYMANAGER_REMOTE_ACCESS=\"yes\"+g" \ -e "s+DISPLAYMANAGER_STARTS_XSERVER=.*+DISPLAYMANAGER_STARTS_XSERVER=\"no\"+g" \ @@ -198,12 +165,6 @@ mv %{buildroot}%{_libdir}/X11/xdm/chooser %{buildroot}%{_bindir} # fdo#35868 (closed INVALID, but because of above fix, we want it) ln -s xdm.8%{?ext_man} %{buildroot}%{_mandir}/man8/chooser.8%{?ext_man} install -D %{SOURCE5} -m 0644 %{buildroot}%{_datadir}/xsessions/xsession.desktop -%if 0%{?suse_version} < 1315 -# missing manual page -mkdir -p %{buildroot}%{_mandir}/man8 -ln -s ../man7/init.d.7%{?ext_man} %{buildroot}%{_mandir}/man8/rcxdm.8%{?ext_man} -ln -sf %{_sysconfdir}/init.d/xdm %{buildroot}%{_sbindir}/rcxdm -%else rm -f %{buildroot}%{_sbindir}/rcxdm install -D %{SOURCE4} -m 0444 %{buildroot}%{_unitdir}/display-manager.service ln -sf service %{buildroot}%{_sbindir}/rcdisplay-manager @@ -212,7 +173,6 @@ cat > %{buildroot}%{_sbindir}/rcxdm <<-'EOF' exec -a rcdisplay-manager %{_sbindir}/rcdisplay-manager ${1+"$@"} EOF chmod 0755 %{buildroot}%{_sbindir}/rcxdm -%endif %if 0%{?suse_version} >= 1330 # prepare for defaul-dm to be chosen by means of update-alternatives mkdir -p %{buildroot}%{_sysconfdir}/alternatives @@ -223,12 +183,8 @@ touch %{buildroot}/usr/lib/X11/displaymanagers/console %endif %post -%if 0%{?suse_version} < 1315 -%{fillup_and_insserv -Y xdm} -%else %service_add_post display-manager.service %{fillup_only -n displaymanager} -%endif %if 0%{?suse_version} >= 1330 %{_sbindir}/update-alternatives --install /usr/lib/X11/displaymanagers/default-displaymanager \ default-displaymanager /usr/lib/X11/displaymanagers/console 5 @@ -242,17 +198,11 @@ sed -i 's/DISPLAYMANAGER=.*//g' /etc/sysconfig/displaymanager %endif %pre -%if !0%{?suse_version} < 1315 - %service_add_pre display-manager.service -%endif +%service_add_pre display-manager.service %postun -%if 0%{?suse_version} < 1315 -%{insserv_cleanup} -%else # Do not restart DM on update (bnc#886641) %service_del_postun -n display-manager.service -%endif %if 0%{?suse_version} >= 1330 [ -f /usr/lib/X11/displaymanagers/console ] || %{_sbindir}/update-alternatives \ --remove default-displaymanager /usr/lib/X11/displaymanagers/console @@ -261,9 +211,7 @@ sed -i 's/DISPLAYMANAGER=.*//g' /etc/sysconfig/displaymanager %endif %preun -%if !0%{?suse_version} < 1315 - %service_del_preun display-manager.service -%endif +%service_del_preun display-manager.service %files %defattr(-,root,root) @@ -276,14 +224,6 @@ sed -i 's/DISPLAYMANAGER=.*//g' /etc/sysconfig/displaymanager /usr/lib/X11/displaymanagers/default-displaymanager %ghost %{_sysconfdir}/alternatives/default-displaymanager %endif -%if %dm_fallbacks -%{_dminitdir}/entrance.fallback -%{_dminitdir}/gdm.fallback -%{_dminitdir}/kdm.fallback -%{_dminitdir}/lxdm.fallback -%{_dminitdir}/slim.fallback -%{_dminitdir}/wdm.fallback -%endif %config %{_sysconfdir}/X11/xdm/ %dir %{_sysconfdir}/X11/xdm/scripts %if 0%{?suse_version} > 1320 @@ -293,14 +233,9 @@ sed -i 's/DISPLAYMANAGER=.*//g' /etc/sysconfig/displaymanager %else %config(noreplace) %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/xdmcp %endif -%if 0%{?suse_version} < 1315 -%{_sysconfdir}/init.d/xdm -%exclude /usr/lib/X11/display-manager -%else %exclude %{_sysconfdir}/init.d/xdm %{_unitdir}/display-manager.service /usr/lib/X11/display-manager -%endif %config %{_sysconfdir}/logrotate.d/xdm %config(noreplace) %{_sysconfdir}/pam.d/xdm %config(noreplace) %{_sysconfdir}/pam.d/xdm-np @@ -311,17 +246,12 @@ sed -i 's/DISPLAYMANAGER=.*//g' /etc/sysconfig/displaymanager %{_bindir}/chooser %{_bindir}/xdm %{_sbindir}/rcxdm -%if 0%{?suse_version} >= 1315 %{_sbindir}/rcdisplay-manager -%endif %{_libdir}/X11/xdm/ %dir %{_datadir}/X11/app-defaults %{_datadir}/X11/app-defaults/Chooser %{_mandir}/man8/chooser.8%{?ext_man} %{_mandir}/man8/xdm.8%{?ext_man} -%if 0%{?suse_version} < 1315 -%{_mandir}/man8/rcxdm.8%{?ext_man} -%endif %ifnarch %ix86 %dir %{_libdir}/X11 %endif