- sysconfig/windowmanager is deprecated since 7 years, don't

read it if it does not exist.

OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xdm?expand=0&rev=275
This commit is contained in:
Joan Torres 2024-08-12 08:17:10 +00:00 committed by Git OBS Bridge
commit d5d5915e45
13 changed files with 2121 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

36
HOWTO.xdm Normal file
View File

@ -0,0 +1,36 @@
Display Manager Scriptlets HOWTO
================================
To keep display manager specific code out of the generic
start script (/etc/init.d/xdm) as much as possible display
managers should provide a script file that provides anything
specific to this dm.
At minimum the script file needs to provide:
here <DM> denotes the name of the file. This should
be the same as the pid file generated by the display
manager - without the .pid extent.
# this function matches the command line argument. If it
finds a match it initializes any dm specific variables
and returns 0 (success) otherwise it returns 1 (fail).
At minimum it needs to set the full path the the display
manager binary.
It may set STARTPROC to a function that gets run prior to
starting a dm, RELOADPROC to a function that's run to reload
the DM configuration, PROBEPROC to a function that's run
when the DM status is probed.
Any those functions should return 0 on success or any other
value on failure.
Additionally it may initialize any other variables needed
by the DM.
<DM>_vars() {
case $1 in
<thisdm>)
DISPLAYMANAGER=/usr/bin/<thisdm>
STARTPROC=<DM>_start # optional
RELOADPROC=<DM>_reload # optional
PROBEPROC=<DM>_probe # optional
....
}

18
display-manager.service Normal file
View File

@ -0,0 +1,18 @@
[Unit]
Description=X Display Manager
Conflicts=getty@tty7.service plymouth-quit.service
After=ypbind.service gpm.service winbind.service acpid.service
Wants=systemd-user-sessions.service systemd-logind.service
After=systemd-user-sessions.service systemd-logind.service
OnFailure=plymouth-quit.service
[Service]
Type=forking
PIDFile=/run/displaymanager.pid
ExecStart=/usr/lib/X11/display-manager start
ExecReload=/usr/lib/X11/display-manager reload
KillMode=process
[Install]
WantedBy=graphical.target
Alias=xdm.service

View File

@ -0,0 +1,156 @@
From d0e32620bfb3bc8803bffcec3f0f3b1db6440d51 Mon Sep 17 00:00:00 2001
From: Matthieu Herrb <matthieu@herrb.eu>
Date: Sat, 14 Mar 2015 20:05:25 +0100
Subject: [PATCH] Allow the greeter to set the input fields bg color
A new 'inpColor' resource is added for that.
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
---
config/Xresources.in | 1 +
greeter/Login.c | 26 ++++++++++++++++++++------
greeter/Login.h | 1 +
greeter/LoginP.h | 2 ++
4 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/config/Xresources.in b/config/Xresources.in
index 0a92270..c880db7 100644
--- a/config/Xresources.in
+++ b/config/Xresources.in
@@ -46,6 +46,7 @@ xlogin*innerFramesWidth: 2
xlogin*shdColor: grey30
xlogin*hiColor: grey90
xlogin*background: grey
+xlogin*inpColor: grey80
!xlogin*foreground: darkgreen
xlogin*greetColor: Blue3
xlogin*failColor: red
diff --git a/greeter/Login.c b/greeter/Login.c
index d899376..6a99050 100644
--- a/greeter/Login.c
+++ b/greeter/Login.c
@@ -156,6 +156,8 @@ static XtResource resources[] = {
offset(hipixel), XtRString, XtDefaultForeground},
{XtNshdColor, XtCForeground, XtRPixel, sizeof (Pixel),
offset(shdpixel), XtRString, XtDefaultForeground},
+ {XtNinpColor, XtCForeground, XtRPixel, sizeof (Pixel),
+ offset(inppixel), XtRString, XtDefaultBackground},
{XtNframeWidth, XtCFrameWidth, XtRInt, sizeof(int),
offset(outframewidth), XtRImmediate, (XtPointer) 1},
{XtNinnerFramesWidth, XtCFrameWidth, XtRInt, sizeof(int),
@@ -325,14 +327,14 @@ XmuXftTextWidth(Display *dpy, XftFont *font, FcChar8 *string, int len);
F_ASCENT(greet) + Y_INC(w)) + \
(n * PROMPT_SPACE_Y(w)))
#define PROMPT_W(w) (w->core.width - (2 * TEXT_X_INC(w)))
-#define PROMPT_H(w) (3 * Y_INC(w) / 2)
+#define PROMPT_H(w) (5 * Y_INC(w) / 4)
#define VALUE_X(w,n) (PROMPT_X(w) + CUR_PROMPT_W(w,n))
#define CURSOR_W 5
#define MAX_VALUE_W(w,n) (PROMPT_W(w) - VALUE_X (w,n) - CURSOR_W - 1 - \
(w->login.inframeswidth * 2) - LOGO_W(w))
#define PROMPT_SPACE_Y(w) (10 * Y_INC(w) / 5)
-#define ERROR_X(w,m) ((int)(w->core.width - STRING_WIDTH (fail, m)) / 2)
+#define ERROR_X(w,m) ((int)(w->core.width - LOGO_W(w) - STRING_WIDTH (fail, m)) / 2)
#define FAIL_X(w) ERROR_X(w, w->login.fail)
#define FAIL_Y(w) (PROMPT_Y(w,1) + 2 * FAIL_Y_INC (w) + F_ASCENT(fail))
@@ -744,14 +746,15 @@ draw_it (LoginWidget w)
int in_width = PROMPT_W(w) - VALUE_X(w,p) - LOGO_W(w);
int in_height = PROMPT_H(w) + w->login.inframeswidth + 2;
- GC topLeftGC, botRightGC;
+ GC topLeftGC, botRightGC, inpGC;
if ((PROMPT_STATE(w, p) == LOGIN_PROMPT_ECHO_ON) ||
(PROMPT_STATE(w, p) == LOGIN_PROMPT_ECHO_OFF)) {
topLeftGC = w->login.shdGC;
botRightGC = w->login.hiGC;
+ inpGC = w->login.inpGC;
} else {
- topLeftGC = botRightGC = w->login.bgGC;
+ topLeftGC = botRightGC = inpGC = w->login.bgGC;
}
/* draw borders of editboxes */
@@ -775,6 +778,11 @@ draw_it (LoginWidget w)
in_frame_x + i-1, in_frame_y + in_height-i,
in_frame_x + in_width-i, in_frame_y + in_height-i);
}
+ XFillRectangle(XtDisplay (w), XtWindow (w), inpGC,
+ in_frame_x + w->login.inframeswidth,
+ in_frame_y + w->login.inframeswidth,
+ in_width - 2*w->login.inframeswidth,
+ in_height - 2*w->login.inframeswidth);
}
if (GREETING(w)[0]) {
@@ -1682,6 +1690,11 @@ static void Initialize (
valuemask = GCForeground | GCBackground;
w->login.shdGC = XtGetGC(gnew, valuemask, &myXGCV);
+ myXGCV.foreground = w->login.inppixel;
+ myXGCV.background = w->core.background_pixel;
+ valuemask = GCForeground | GCBackground;
+ w->login.inpGC = XtGetGC(gnew, valuemask, &myXGCV);
+
myXGCV.foreground = TEXT_COLOR(text);
myXGCV.background = w->core.background_pixel;
valuemask = GCForeground | GCBackground;
@@ -1692,10 +1705,10 @@ static void Initialize (
}
#endif
w->login.textGC = XtGetGC(gnew, valuemask, &myXGCV);
- myXGCV.foreground = w->core.background_pixel;
+ myXGCV.foreground = w->login.inppixel;
w->login.bgGC = XtGetGC(gnew, valuemask, &myXGCV);
- myXGCV.foreground = TEXT_COLOR(text) ^ w->core.background_pixel;
+ myXGCV.foreground = TEXT_COLOR(text) ^ w->login.inppixel;
myXGCV.function = GXxor;
xvaluemask = valuemask | GCFunction;
w->login.xorGC = XtGetGC (gnew, xvaluemask, &myXGCV);
@@ -1961,6 +1974,7 @@ static void Destroy (Widget gw)
#endif
XtReleaseGC(gw, w->login.hiGC);
XtReleaseGC(gw, w->login.shdGC);
+ XtReleaseGC(gw, w->login.inpGC);
#ifdef XPM
if (True == w->login.logoValid)
diff --git a/greeter/Login.h b/greeter/Login.h
index 9b5212c..6af3369 100644
--- a/greeter/Login.h
+++ b/greeter/Login.h
@@ -111,6 +111,7 @@ from The Open Group.
/* added by Amit Margalit Oct 1996 */
# define XtNhiColor "hiColor"
# define XtNshdColor "shdColor"
+# define XtNinpColor "inpColor"
# define XtNframeWidth "frameWidth"
# define XtCFrameWidth "FrameWidth"
# define XtNinnerFramesWidth "innerFramesWidth"
diff --git a/greeter/LoginP.h b/greeter/LoginP.h
index bd82ce3..57ed182 100644
--- a/greeter/LoginP.h
+++ b/greeter/LoginP.h
@@ -95,6 +95,7 @@ typedef struct {
# endif
Pixel hipixel; /* frame hilite pixel */
Pixel shdpixel; /* shadow frame pixel */
+ Pixel inppixel; /* input field bg pixel */
GC textGC; /* pointer to GraphicsContext */
GC bgGC; /* pointer to GraphicsContext */
GC xorGC; /* pointer to GraphicsContext */
@@ -105,6 +106,7 @@ typedef struct {
# endif
GC hiGC; /* for hilight part of frame */
GC shdGC; /* for shaded part of frame */
+ GC inpGC; /* for input field of frame */
char *greeting; /* greeting */
char *unsecure_greet;/* message displayed when insecure */
char *namePrompt; /* name prompt */
--
2.21.0

3
xdm-1.1.16.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bcf2209881e95708363777b282fedb1c1055790f38046fa46beff2f1d087679c
size 420072

348
xdm-tarball.patch Normal file
View File

@ -0,0 +1,348 @@
diff -u -r ../old/etc/X11/xdm/RunChooser ./etc/X11/xdm/RunChooser
--- ../old/etc/X11/xdm/RunChooser 2015-07-29 14:46:22.000000000 +0200
+++ ./etc/X11/xdm/RunChooser 2024-08-09 11:27:04.390249591 +0200
@@ -9,7 +9,7 @@
#
LIBDIR=/usr/lib/X11
ETCDIR=/etc/X11
- XDMDIR=${ETCDIR}/xdm
+ XDMDIR=/usr/${ETCDIR}/xdm
BINDIR=/usr/bin
no_exit_on_failed_exec=1
@@ -107,6 +107,8 @@
cat $sysxkbmap | $xkbcomp - $DISPLAY
elif test -r $sysmodmap ; then
$xmodmap $sysmodmap
+ elif test -r /usr/etc/X11/Xmodmap; then
+ $xmodmap /usr/etc/X11/Xmodmap
fi
else
# TCP/IP connection (remote or local)
@@ -114,6 +116,8 @@
cat $defxkbmap | $xkbcomp - $DISPLAY
elif test -r $defmodmap ; then
$xmodmap $defmodmap
+ elif test -r /usr/etc/X11/Xmodmap.remote; then
+ $xmodmap /usr/etc/X11/Xmodmap.remote
fi
if test -s $hostxkbmap -a -x $xkbcomp ; then
cat $hostxkbmap | $xkbcomp - $DISPLAY
diff -u -r ../old/etc/X11/xdm/Xreset ./etc/X11/xdm/Xreset
--- ../old/etc/X11/xdm/Xreset 2014-12-15 19:34:46.000000000 +0100
+++ ./etc/X11/xdm/Xreset 2024-08-09 11:27:04.390249591 +0200
@@ -10,7 +10,7 @@
#
LIBDIR=/usr/lib/X11
ETCDIR=/etc/X11
- XDMDIR=${ETCDIR}/xdm
+ XDMDIR=/usr/${ETCDIR}/xdm
BINDIR=/usr/bin
xmessage=${BINDIR}/xmessage
xconsole=${BINDIR}/xconsole
diff -u -r ../old/etc/X11/xdm/Xresources ./etc/X11/xdm/Xresources
--- ../old/etc/X11/xdm/Xresources 2015-08-04 12:13:36.000000000 +0200
+++ ./etc/X11/xdm/Xresources 2024-08-09 11:27:04.390249591 +0200
@@ -100,4 +100,4 @@
!
! Include system wide Xresources
!
-#include "/etc/X11/Xresources"
+#include "/usr/etc/X11/Xresources"
diff -u -r ../old/etc/X11/xdm/Xsession ./etc/X11/xdm/Xsession
--- ../old/etc/X11/xdm/Xsession 2021-01-04 15:20:27.548208000 +0100
+++ ./etc/X11/xdm/Xsession 2024-08-09 11:27:04.390249591 +0200
@@ -34,10 +34,18 @@
# Some system defaults
#
XETCDIR=/etc/X11
- XDMDIR=$XETCDIR/xdm
- XINITDIR=$XETCDIR/xinit
+ XDMDIR=/usr/$XETCDIR/xdm
: ${TMPDIR=/tmp}
+# xinitrc moved to %{_libexecdir}/xinit in xinit package
+if [ -r /usr/libexec/xinit/xinitrc ]; then
+ XINITDIR=/usr/libexec/xinit
+elif [ -r /usr/lib/xinit/xinitrc ]; then
+ XINITDIR=/usr/lib/xinit
+else
+ XINITDIR=$XETCDIR/xinit
+fi
+
export OPENWINHOME TMPDIR
test -n "$XAUTHORITY" || unset XAUTHORITY
@@ -187,7 +195,11 @@
#
# By default we set system defaults for the language
#
-. /etc/profile.d/lang.sh
+if [ -r /etc/profile.d/lang.sh ]; then
+ . /etc/profile.d/lang.sh
+elif [ -r /usr/etc/profile.d/lang.sh ]; then
+ . /usr/etc/profile.d/lang.sh
+fi
#
# Handle arguments given by xdm/kdm/gdm.
@@ -261,7 +273,11 @@
# No window manager? Get system default
#
if test -z "$WINDOWMANAGER" ; then
- . /etc/profile.d/profile.sh
+ if [ -r /etc/profile.d/profile.sh ]; then
+ . /etc/profile.d/profile.sh
+ elif [ -r /usr/etc/profile.d/profile.sh ]; then
+ . /usr/etc/profile.d/profile.sh
+ fi
fi
#
@@ -291,7 +307,12 @@
# Source common code shared between the
# X session and X init scripts
#
-. /etc/X11/xinit/xinitrc.common
+
+if [ -r /etc/X11/xinit/xinitrc.common ]; then
+ . /etc/X11/xinit/xinitrc.common
+elif [ -r /usr/etc/X11/xinit/xinitrc.common ]; then
+ . /usr/etc/X11/xinit/xinitrc.common
+fi
# Restore arguments but skip window manager
set -- "${argv[@]}"
diff -u -r ../old/etc/X11/xdm/Xsetup ./etc/X11/xdm/Xsetup
--- ../old/etc/X11/xdm/Xsetup 2020-08-26 15:35:43.014615021 +0200
+++ ./etc/X11/xdm/Xsetup 2024-08-09 11:27:04.390249591 +0200
@@ -9,7 +9,7 @@
#
LIBDIR=/usr/lib/X11
ETCDIR=/etc/X11
- XDMDIR=${ETCDIR}/xdm
+ XDMDIR=/usr/${ETCDIR}/xdm
BINDIR=/usr/bin
no_exit_on_failed_exec=1
@@ -184,7 +184,7 @@
#endif
EOF
else
- $xrdb $cpp -override -retain ${ETCDIR}/Xresources
+ $xrdb $cpp -override -retain ${XDMDIR}/Xresources
fi
#
@@ -206,6 +206,8 @@
cat $sysxkbmap | $xkbcomp - $DISPLAY
elif test -r $sysmodmap ; then
$xmodmap $sysmodmap
+ elif test -r /usr/etc/X11/Xmodmap ; then
+ $xmodmap /usr/etc/X11/Xmodmap
fi
else
# TCP/IP connection (remote or local)
@@ -213,6 +215,8 @@
cat $defxkbmap | $xkbcomp - $DISPLAY
elif test -r $defmodmap ; then
$xmodmap $defmodmap
+ elif test -r /usr/etc/X11/Xmodmap.remote ; then
+ $xmodmap /usr/etc/X11/Xmodmap.remote
fi
if test -s $hostxkbmap -a -x $xkbcomp ; then
cat $hostxkbmap | $xkbcomp - $DISPLAY
diff -u -r ../old/etc/X11/xdm/Xstartup ./etc/X11/xdm/Xstartup
--- ../old/etc/X11/xdm/Xstartup 2020-08-26 15:35:26.270871116 +0200
+++ ./etc/X11/xdm/Xstartup 2024-08-09 11:27:04.390249591 +0200
@@ -10,7 +10,7 @@
#
LIBDIR=/usr/lib/X11
ETCDIR=/etc/X11
- XDMDIR=${ETCDIR}/xdm
+ XDMDIR=/usr/${ETCDIR}/xdm
BINDIR=/usr/bin
xmessage=${BINDIR}/xmessage
NOLOGIN=/etc/nologin
diff -u -r ../old/etc/X11/xdm/sys.xsession ./etc/X11/xdm/sys.xsession
--- ../old/etc/X11/xdm/sys.xsession 2016-06-03 15:25:42.000000000 +0200
+++ ./etc/X11/xdm/sys.xsession 2024-08-09 11:27:04.390249591 +0200
@@ -38,10 +38,16 @@
argv=("$@")
set --
-for script in /etc/X11/xdm/scripts/*
+for script in /usr/etc/X11/xdm/scripts/* \
+ /etc/X11/xdm/scripts/*
do
test -e $script || continue
test -d $script && continue
+ # higher priority for /etc/X11/xdm/scripts ...
+ if echo $script | grep -q ^/usr; then
+ sname=$(basename $script)
+ test -e /etc/X11/xdm/scripts/$sname && continue
+ fi
case "${script##*/}" in
.*) continue ;;
*.rpm*) continue ;;
@@ -63,7 +69,16 @@
#
# Use system default xinitrc if the users does not have one.
#
-XINITRCFILE=/etc/X11/xinit/xinitrc
+
+# xinitrc moved to %{_libexecdir}/xinit in xinit package
+if [ -r /usr/libexec/xinit/xinitrc ]; then
+ XINITRCFILE=/usr/libexec/xinit/xinitrc
+elif [ -r /usr/lib/xinit/xinitrc ]; then
+ XINITRCFILE=/usr/lib/xinit/xinitrc
+else
+ XINITRCFILE=/etc/X11/xinit/xinitrc
+fi
+
test -r "$HOME/.xinitrc" && XINITRCFILE="$HOME/.xinitrc"
if test -f "$XINITRCFILE" ; then
@@ -77,7 +92,11 @@
# Source common code shared between the
# X session and X init scripts
#
- . /etc/X11/xinit/xinitrc.common
+ if [ -r /etc/X11/xinit/xinitrc.common ]; then
+ . /etc/X11/xinit/xinitrc.common
+ elif [ -r /usr/etc/X11/xinit/xinitrc.common ]; then
+ . /usr/etc/X11/xinit/xinitrc.common
+ fi
unset STARTUP WINDOW_MANAGER
set -- ${1+"$@"} $WINDOWMANAGER
diff -u -r ../old/etc/X11/xdm/xdm-config ./etc/X11/xdm/xdm-config
--- ../old/etc/X11/xdm/xdm-config 2020-08-26 15:36:22.290004407 +0200
+++ ./etc/X11/xdm/xdm-config 2024-08-09 11:27:04.390249591 +0200
@@ -4,10 +4,10 @@
DisplayManager.errorLogFile: /var/log/xdm.errors
DisplayManager.pidFile: /run/xdm.pid
DisplayManager.authDir: /var/lib/xdm
-DisplayManager.keyFile: /etc/X11/xdm/xdm-keys
+DisplayManager.keyFile: /usr/etc/X11/xdm/xdm-keys
DisplayManager.servers: /etc/X11/xdm/Xservers
-DisplayManager.accessFile: /etc/X11/xdm/Xaccess
-DisplayManager.willing: su nobody -c /etc/X11/xdm/Xwilling
+DisplayManager.accessFile: /usr/etc/X11/xdm/Xaccess
+DisplayManager.willing: su nobody -c /usr/etc/X11/xdm/Xwilling
!
! ATTENTION: `authName' should be in general MIT-MAGIC-COOKIE-1
! For XDM-AUTHENTICATION-1 which is default for xterminals see
@@ -27,16 +27,16 @@
! The scripts handling the setup, the startup, the session its self,
! and the reset of an X session.
!
-DisplayManager.*.setup: /etc/X11/xdm/Xsetup
-DisplayManager.*.chooser: /etc/X11/xdm/RunChooser
-DisplayManager.*.startup: /etc/X11/xdm/Xstartup
-DisplayManager.*.session: /etc/X11/xdm/Xsession
-DisplayManager.*.reset: /etc/X11/xdm/Xreset
+DisplayManager.*.setup: /usr/etc/X11/xdm/Xsetup
+DisplayManager.*.chooser: /usr/etc/X11/xdm/RunChooser
+DisplayManager.*.startup: /usr/etc/X11/xdm/Xstartup
+DisplayManager.*.session: /usr/etc/X11/xdm/Xsession
+DisplayManager.*.reset: /usr/etc/X11/xdm/Xreset
!
DisplayManager._0.terminateServer: true
DisplayManager._93.terminateServer: true
!
-DisplayManager*resources: /etc/X11/xdm/Xresources
+DisplayManager*resources: /usr/etc/X11/xdm/Xresources
DisplayManager.*.terminateServer: false
!
! SECURITY: do not listen for XDMCP or Chooser requests
diff -u -r ../old/usr/lib/X11/display-manager ./usr/lib/X11/display-manager
--- ../old/usr/lib/X11/display-manager 2020-09-04 13:11:23.054517000 +0200
+++ ./usr/lib/X11/display-manager 2024-08-09 11:36:39.578216426 +0200
@@ -13,11 +13,16 @@
# /usr/lib/X11/display-manager
#
+DEFAULT_WM="default"
+
. /etc/sysconfig/displaymanager
. /etc/sysconfig/language
-. /etc/sysconfig/windowmanager
-test -e /etc/SuSEconfig/profile && . /etc/SuSEconfig/profile
-test -r /etc/profile.d/desktop-data.sh && . /etc/profile.d/desktop-data.sh
+test -f /etc/sysconfig/windowmanager && . /etc/sysconfig/windowmanager
+if [ -r /etc/profile.d/desktop-data.sh ]; then
+ . /etc/profile.d/desktop-data.sh
+elif [ -r /usr/etc/profile.d/desktop-data.sh ]; then
+ . /usr/etc/profile.d/desktop-data.sh
+fi
locale_vars=" \
LANG \
@@ -67,14 +72,14 @@
unset DEFAULT_WM
export WINDOWMANAGER
-DMDIR=/etc/X11/xdm
+DMDIR=/usr/etc/X11/xdm
RELOADSIGNAL="-HUP"
PIDFILELNK="/run/displaymanager.pid"
xdm_reload_files () {
- if [ -x /etc/X11/xdm/SuSEconfig.xdm ]; then
+ if [ -x $DMIR/SuSEconfig.xdm ]; then
# Do no try to start Xserver on platforms which may ship without
# graphics card (bsc#1039497)
if [ "$(arch)" == "aarch64" -o "$(arch)" == "ppc64le" ]; then
@@ -87,8 +92,8 @@
fi
fi
MD5DIR="/var/adm/SuSEconfig/md5" \
- /etc/X11/xdm/SuSEconfig.xdm | \
- sed 's+\(.*\)+/etc/init.d/xdm: \1+g' | \
+ $DMDIR/SuSEconfig.xdm | \
+ sed 's+\(.*\)+/usr/lib/X11/display-manager: \1+g' | \
/bin/logger
return 0
fi
@@ -130,6 +135,13 @@
exit 0
;;
*)
+ test -d /etc/X11/xdm || mkdir -p /etc/X11/xdm
+ # SUSEconfig.xdm edits these files appropriate to /etc/sysconfig/displaymanager
+ test -r /etc/X11/xdm/xdm-config || cp $DMDIR/xdm-config /etc/X11/xdm/xdm-config
+ test -r /etc/X11/xdm/Xservers || cp $DMDIR/Xservers /etc/X11/xdm/Xservers
+ # still often sourced by old ~/.xinitrc or ~/.xsession user files ...
+ test -d /etc/X11/xinit || mkdir -p /etc/X11/xinit
+ test -r /etc/X11/xinit/xinitrc.common || ln -snf /usr/etc/X11/xinit/xinitrc.common /etc/X11/xinit/xinitrc.common
for i in /usr/lib/X11/displaymanagers/*
do
tmp=${i%.fallback}
@@ -159,8 +171,8 @@
start)
# use system keyboard as global X keyboard configuration
- if [ -x /etc/X11/xdm/keytable ]; then
- /etc/X11/xdm/keytable
+ if [ -x $DMDIR/keytable ]; then
+ $DMDIR/keytable
fi
[ -n "$STARTPROC" ] && $STARTPROC
diff -u -r ../old/usr/lib/X11/displaymanagers/xdm ./usr/lib/X11/displaymanagers/xdm
--- ../old/usr/lib/X11/displaymanagers/xdm 2014-03-04 13:53:31.000000000 +0100
+++ ./usr/lib/X11/displaymanagers/xdm 2024-08-09 11:27:04.390249591 +0200
@@ -5,8 +5,8 @@
}
xdm_probe_proc() {
- if test $XDMDIR/xdm-config -nt $PIDFILE -o \
- $XDMDIR/Xservers -nt $PIDFILE
+ if test /etc/X11/xdm/xdm-config -nt $PIDFILE -o \
+ /etc/X11/xdm/Xservers -nt $PIDFILE
then
echo reload
fi

View File

@ -0,0 +1,117 @@
Index: xdm/auth.c
===================================================================
--- xdm.orig/auth.c
+++ xdm/auth.c
@@ -744,7 +744,7 @@ writeAddr (
}
static void
-DefineLocal (FILE *file, Xauth *auth)
+DefineLocal (FILE *file, Xauth *auth, char **pLocalAddress)
{
char displayname[100];
int len = _XGetHostname (displayname, sizeof(displayname));
@@ -759,6 +759,9 @@ DefineLocal (FILE *file, Xauth *auth)
writeAddr (FamilyLocal, len, displayname, file, auth);
+
+ if (pLocalAddress)
+ *pLocalAddress = strdup(displayname);
}
#ifdef HAVE_GETIFADDRS
@@ -1019,7 +1022,7 @@ setAuthNumber (Xauth *auth, char *name)
}
static void
-writeLocalAuth (FILE *file, Xauth *auth, char *name)
+writeLocalAuth (FILE *file, Xauth *auth, char *name, char **pLocalAddress)
{
int fd;
@@ -1034,13 +1037,13 @@ writeLocalAuth (FILE *file, Xauth *auth,
DefineSelf (fd, file, auth);
close (fd);
#endif
- DefineLocal (file, auth);
+ DefineLocal (file, auth, pLocalAddress);
}
#ifdef XDMCP
static void
-writeRemoteAuth (FILE *file, Xauth *auth, XdmcpNetaddr peer, int peerlen, char *name)
+writeRemoteAuth (FILE *file, Xauth *auth, XdmcpNetaddr peer, int peerlen, char *name, char **pLocalAddress)
{
int family = FamilyLocal;
char *addr;
@@ -1059,7 +1062,7 @@ writeRemoteAuth (FILE *file, Xauth *auth
}
else
{
- writeLocalAuth (file, auth, name);
+ writeLocalAuth (file, auth, name, pLocalAddress);
}
}
@@ -1083,6 +1086,7 @@ SetUserAuthorization (struct display *d,
#ifdef HAVE_MKSTEMP
int fd;
#endif
+ char *localAddress = NULL;
Debug ("SetUserAuthorization\n");
auths = d->authorizations;
@@ -1175,10 +1179,10 @@ SetUserAuthorization (struct display *d,
{
magicCookie = i;
if (d->displayType.location == Local)
- writeLocalAuth (new, auths[i], d->name);
+ writeLocalAuth (new, auths[i], d->name, &localAddress);
#ifdef XDMCP
else
- writeRemoteAuth (new, auths[i], d->peer, d->peerlen, d->name);
+ writeRemoteAuth (new, auths[i], d->peer, d->peerlen, d->name, &localAddress);
#endif
break;
}
@@ -1196,10 +1200,10 @@ SetUserAuthorization (struct display *d,
!strncmp (auths[i]->name, "MIT-KERBEROS-5", 14))
auths[i]->data_length = 0;
if (d->displayType.location == Local)
- writeLocalAuth (new, auths[i], d->name);
+ writeLocalAuth (new, auths[i], d->name, &localAddress);
#ifdef XDMCP
else
- writeRemoteAuth (new, auths[i], d->peer, d->peerlen, d->name);
+ writeRemoteAuth (new, auths[i], d->peer, d->peerlen, d->name, &localAddress);
#endif
auths[i]->data_length = data_len;
}
@@ -1244,6 +1248,12 @@ SetUserAuthorization (struct display *d,
verify->systemEnviron = setEnv (verify->systemEnviron,
"XAUTHORITY", envname);
}
+ if (localAddress) {
+ verify->userEnviron = setEnv (verify->userEnviron,
+ "XAUTHLOCALHOSTNAME",localAddress);
+ free(localAddress);
+ }
+
XauUnlockAuth (name);
if (envname)
chown (envname, verify->uid, verify->gid);
@@ -1282,10 +1292,10 @@ RemoveUserAuthorization (struct display
for (i = 0; i < d->authNum; i++)
{
if (d->displayType.location == Local)
- writeLocalAuth (new, auths[i], d->name);
+ writeLocalAuth (new, auths[i], d->name, NULL);
#ifdef XDMCP
else
- writeRemoteAuth (new, auths[i], d->peer, d->peerlen, d->name);
+ writeRemoteAuth (new, auths[i], d->peer, d->peerlen, d->name, NULL);
#endif
}
doWrite = 1;

1056
xdm.changes Normal file

File diff suppressed because it is too large Load Diff

285
xdm.spec Normal file
View File

@ -0,0 +1,285 @@
#
# spec file for package xdm
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define _dminitdir %{_prefix}/lib/X11/displaymanagers
%if 0%{?suse_version} >= 1550
%define UsrEtcMove 1
%endif
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir %{_localstatedir}/adm/fillup-templates
%endif
Name: xdm
Version: 1.1.16
Release: 0
Summary: X Display Manager
License: MIT
Group: System/X11/Utilities
URL: https://xorg.freedesktop.org/
Source0: http://xorg.freedesktop.org/releases/individual/app/%{name}-%{version}.tar.xz
Source1: xdm.tar.bz2
Source2: HOWTO.xdm
Source4: display-manager.service
Source5: xsession.desktop
Patch1: xdm-tolerant-hostname-changes.diff
Patch2: xdm-tarball.patch
Patch3: n_Allow-the-greeter-to-set-the-input-fields-bg-color.patch
Patch4: xinit-UsrEtcMove.patch
BuildRequires: firewall-macros
BuildRequires: libtool
BuildRequires: pam-devel
BuildRequires: pkgconfig
BuildRequires: systemd-rpm-macros
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xau)
BuildRequires: pkgconfig(xaw7)
BuildRequires: pkgconfig(xdmcp)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(xft)
BuildRequires: pkgconfig(xinerama)
BuildRequires: pkgconfig(xmu)
BuildRequires: pkgconfig(xorg-macros) >= 1.4
BuildRequires: pkgconfig(xpm)
BuildRequires: pkgconfig(xt)
BuildRequires: pkgconfig(xtrans)
Requires: %fillup_prereq
Requires: /sbin/startproc
Requires: cpp
Requires: logrotate
Requires: sessreg
Requires: xconsole
Requires: xinit
Requires: xli
Requires: xmessage
Requires: xrdb
Requires: xset
Requires: xsetroot
Requires: xterm-bin
Recommends: dbus-1-x11
Recommends: xdmbgrd
# This was part of the xorg-x11 package up to version 7.6
Conflicts: xorg-x11 <= 7.6
%{?systemd_requires}
%if 0%{?suse_version} >= 1550
Requires: %{_bindir}/pidof
%else
Requires: /sbin/pidof
%endif
%description
Xdm manages a collection of X displays, which may be on the local host
or remote servers.
%package xsession
Summary: User/System Xsession Desktop File
Group: System/X11/Utilities
Requires: xdm
Enhances: xdm
%description xsession
This package contains the System desktop file which will cause
the execution of a user provided $HOME/.xsession script or pick
the system wide DM default set in %{_sysconfdir}/sysconfig/displaymanager.
%prep
%setup -q
cp %{SOURCE2} .
pushd xdm
%patch -P 1 -p1
popd
# reverse apply (boo#1130321)
%patch -P 3 -p1 -R
%build
# needed for patch0
autoreconf -fi
%configure \
--disable-static \
--with-pam \
--with-xdmconfigdir=%{_sysconfdir}/X11/xdm \
--with-xdmscriptdir=%{_sysconfdir}/X11/xdm \
--with-systemdsystemunitdir=no
%make_build
%install
%make_install
# Not used anymore by SuSE
rm %{buildroot}%{_sysconfdir}/X11/xdm/{GiveConsole,TakeConsole,Xsetup_0}
pushd %{buildroot}
# SuSE default XDM configuration
tar xf %{SOURCE1}
%if 0%{?UsrEtcMove}
patch -p0 < %{PATCH2}
mkdir -p usr%{_sysconfdir}/X11/xdm
mv etc/X11/xdm/* usr%{_sysconfdir}/X11/xdm
# Edited by SUSEConfig.xdm, package a copy
for i in xdm-config Xservers; do
cp usr%{_sysconfdir}/X11/xdm/$i etc/X11/xdm/$i
done
mkdir -p ./%{_pam_vendordir}
rm etc/pam.d/{xdm,xdm-np}.sle15
mv etc/pam.d/* ./%{_pam_vendordir}/
%else
patch -p0 < %{PATCH4}
rm etc/pam.d/{xdm,xdm-np}
mv etc/pam.d/{xdm.sle15,xdm}
mv etc/pam.d/{xdm-np.sle15,xdm-np}
%endif
%if "%{_fillupdir}" != "%{_localstatedir}/adm/fillup-templates"
mkdir -p %{buildroot}$(dirname %{_fillupdir})
mv %{buildroot}%{_localstatedir}/adm/fillup-templates \
%{buildroot}$(dirname %{_fillupdir})
%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" \
%{buildroot}%{_fillupdir}/sysconfig.displaymanager
%endif
popd
# Correct location (FHS-2.1)
%if 0%{?UsrEtcMove}
ln -s %{_localstatedir}/lib/xdm/authdir %{buildroot}%{_distconfdir}/X11/xdm/authdir
%else
ln -s %{_localstatedir}/lib/xdm/authdir %{buildroot}%{_sysconfdir}/X11/xdm/authdir
%endif
# bnc#223734
rm %{buildroot}%{_libdir}/X11/xdm/libXdmGreet.la
# for FHS compliance (bnc#21857)
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
rm -f %{buildroot}%{_sbindir}/rcxdm
install -D %{SOURCE4} -m 0444 %{buildroot}%{_unitdir}/display-manager.service
ln -sf service %{buildroot}%{_sbindir}/rcdisplay-manager
cat > %{buildroot}%{_sbindir}/rcxdm <<-'EOF'
#!/bin/bash
exec -a rcdisplay-manager %{_sbindir}/rcdisplay-manager ${1+"$@"}
EOF
chmod 0755 %{buildroot}%{_sbindir}/rcxdm
# prepare for defaul-dm to be chosen by means of update-alternatives
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
touch %{buildroot}%{_sysconfdir}/alternatives/default-displaymanager
ln -s %{_sysconfdir}/alternatives/default-displaymanager %{buildroot}%{_prefix}/lib/X11/displaymanagers/default-displaymanager
# Inject a dummy 'console' selection - which used to be choice in /etc/sysconfig/displaymanager
touch %{buildroot}%{_prefix}/lib/X11/displaymanagers/console
%if 0%{?UsrEtcMove}
mkdir -p %{buildroot}%{_distconfdir}/logrotate.d
mv %{buildroot}%{_sysconfdir}/logrotate.d/xdm %{buildroot}%{_distconfdir}/logrotate.d/xdm
%endif
%post
# enable Xorg on s390x with virtio (Redhat PCI ID 1af4:1050) on installation (but not upgrade)
if [ $1 -eq 1 ] ; then
if [ "$(arch)" = "s390x" ]; then
if [ -d /dev/dri ]; then
sed -i -e "s+DISPLAYMANAGER_REMOTE_ACCESS=.*+DISPLAYMANAGER_REMOTE_ACCESS=\"no\"+g" \
-e "s+DISPLAYMANAGER_STARTS_XSERVER=.*+DISPLAYMANAGER_STARTS_XSERVER=\"yes\"+g" \
%{_fillupdir}//sysconfig.displaymanager
fi
fi
fi
%service_add_post display-manager.service
%{fillup_only -n displaymanager}
%{_sbindir}/update-alternatives --install %{_prefix}/lib/X11/displaymanagers/default-displaymanager \
default-displaymanager %{_prefix}/lib/X11/displaymanagers/console 5
%{_sbindir}/update-alternatives --install %{_prefix}/lib/X11/displaymanagers/default-displaymanager \
default-displaymanager %{_prefix}/lib/X11/displaymanagers/xdm 10
# get rid of DISPLAYMANAGER in /etc/sysconfig/displaymanager (boo#1125040)
sed -i 's/DISPLAYMANAGER=.*//g' %{_sysconfdir}/sysconfig/displaymanager
%firewalld_reload
%pre
%service_add_pre display-manager.service
%postun
# Do not restart DM on update (bnc#886641)
%if 0%{?suse_version} >= 1550
%service_del_postun_without_restart display-manager.service
%else
%service_del_postun -n display-manager.service
%endif
[ -f %{_prefix}/lib/X11/displaymanagers/console ] || %{_sbindir}/update-alternatives \
--remove default-displaymanager %{_prefix}/lib/X11/displaymanagers/console
[ -f %{_prefix}/lib/X11/displaymanagers/xdm ] || %{_sbindir}/update-alternatives \
--remove default-displaymanager %{_prefix}/lib/X11/displaymanagers/xdm
%preun
%service_del_preun display-manager.service
%files
%license COPYING
%doc AUTHORS ChangeLog README.md
%doc HOWTO.xdm
%dir %{_dminitdir}
%{_dminitdir}/xdm
%{_dminitdir}/console
%{_prefix}/lib/X11/displaymanagers/default-displaymanager
%ghost %{_sysconfdir}/alternatives/default-displaymanager
%if 0%{?UsrEtcMove}
%dir %{_distconfdir}/X11
%{_distconfdir}/X11/xdm/
%endif
%config %{_sysconfdir}/X11/xdm/
%if 0%{?UsrEtcMove}
%dir %{_distconfdir}/X11/xdm/scripts
%else
%dir %{_sysconfdir}/X11/xdm/scripts
%endif
%dir %{_prefix}/lib/firewalld
%dir %{_prefix}/lib/firewalld/services
%{_prefix}/lib/firewalld/services/x11.xml
%{_unitdir}/display-manager.service
%{_prefix}/lib/X11/display-manager
%if 0%{?UsrEtcMove}
%{_distconfdir}/logrotate.d/xdm
%else
%config %{_sysconfdir}/logrotate.d/xdm
%endif
%if 0%{?UsrEtcMove}
%{_pam_vendordir}/xdm
%{_pam_vendordir}/xdm-np
%else
%config(noreplace) %{_sysconfdir}/pam.d/xdm
%config(noreplace) %{_sysconfdir}/pam.d/xdm-np
%endif
%dir %{_localstatedir}/lib/xdm/
%{_fillupdir}/sysconfig.displaymanager
%{_localstatedir}/lib/xdm/authdir/
%ghost %{_localstatedir}/log/xdm.errors
%{_bindir}/chooser
%{_bindir}/xdm
%{_sbindir}/rcxdm
%{_sbindir}/rcdisplay-manager
%{_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}
%ifnarch %{ix86}
%dir %{_libdir}/X11
%endif
%files xsession
%{_datadir}/xsessions/xsession.desktop
%changelog

BIN
xdm.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

70
xinit-UsrEtcMove.patch Normal file
View File

@ -0,0 +1,70 @@
diff -u -r ../old/etc/X11/xdm/Xsession ./etc/X11/xdm/Xsession
--- ../old/etc/X11/xdm/Xsession 2017-07-25 11:58:00.067080000 +0200
+++ ./etc/X11/xdm/Xsession 2020-09-08 16:49:26.220507000 +0200
@@ -35,9 +35,17 @@
#
XETCDIR=/etc/X11
XDMDIR=$XETCDIR/xdm
- XINITDIR=$XETCDIR/xinit
: ${TMPDIR=/tmp}
+# xinitrc moved to %{_libexecdir}/xinit in xinit package
+if [ -r /usr/libexec/xinit/xinitrc ]; then
+ XINITDIR=/usr/libexec/xinit
+elif [ -r /usr/lib/xinit/xinitrc ]; then
+ XINITDIR=/usr/lib/xinit
+else
+ XINITDIR=$XETCDIR/xinit
+fi
+
export OPENWINHOME TMPDIR
test -n "$XAUTHORITY" || unset XAUTHORITY
@@ -291,7 +299,12 @@
# Source common code shared between the
# X session and X init scripts
#
-. /etc/X11/xinit/xinitrc.common
+
+if [ -r /etc/X11/xinit/xinitrc.common ]; then
+ . /etc/X11/xinit/xinitrc.common
+elif [ -r /usr/etc/X11/xinit/xinitrc.common ]; then
+ . /usr/etc/X11/xinit/xinitrc.common
+fi
# Restore arguments but skip window manager
set -- "${argv[@]}"
diff -u -r ../old/etc/X11/xdm/sys.xsession ./etc/X11/xdm/sys.xsession
--- ../old/etc/X11/xdm/sys.xsession 2016-06-03 15:25:42.000000000 +0200
+++ ./etc/X11/xdm/sys.xsession 2020-09-08 16:54:30.682569000 +0200
@@ -63,7 +63,16 @@
#
# Use system default xinitrc if the users does not have one.
#
-XINITRCFILE=/etc/X11/xinit/xinitrc
+
+# xinitrc moved to %{_libexecdir}/xinit in xinit package
+if [ -r /usr/libexec/xinit/xinitrc ]; then
+ XINITRCFILE=/usr/libexec/xinit/xinitrc
+elif [ -r /usr/lib/xinit/xinitrc ]; then
+ XINITRCFILE=/usr/lib/xinit/xinitrc
+else
+ XINITRCFILE=/etc/X11/xinit/xinitrc
+fi
+
test -r "$HOME/.xinitrc" && XINITRCFILE="$HOME/.xinitrc"
if test -f "$XINITRCFILE" ; then
@@ -77,7 +86,11 @@
# Source common code shared between the
# X session and X init scripts
#
- . /etc/X11/xinit/xinitrc.common
+ if [ -r /etc/X11/xinit/xinitrc.common ]; then
+ . /etc/X11/xinit/xinitrc.common
+ elif [ -r /usr/etc/X11/xinit/xinitrc.common ]; then
+ . /usr/etc/X11/xinit/xinitrc.common
+ fi
unset STARTUP WINDOW_MANAGER
set -- ${1+"$@"} $WINDOWMANAGER

5
xsession.desktop Normal file
View File

@ -0,0 +1,5 @@
[Desktop Entry]
Name=User/System Default
Type=Xsession
Encoding=UTF-8
Exec=default