xdm: Changes to 'upstream-unstable'
.gitignore | 14
AUTHORS | 2
COPYING | 5
Makefile.am | 183 -----
access.c | 991 -----------------------------
app-defaults/.gitignore | 2
app-defaults/Chooser | 51 +
app-defaults/Chooser.ad | 51 -
app-defaults/Makefile.am | 1
auth.c | 1556 ---------------------------------------------
choose.c | 545 ---------------
chooser.c | 1381 ----------------------------------------
chooser/.gitignore | 1
chooser/Makefile.am | 16
chooser/chooser.c | 1381 ++++++++++++++++++++++++++++++++++++++++
config/Makefile.am | 2
config/Xaccess | 4
config/Xresources.cpp | 8
config/Xsession.cpp | 6
config/xdm-config.cpp | 2
configure.ac | 441 ++++++------
cpprules.in | 9
daemon.c | 90 --
dm.c | 1037 ------------------------------
dm.h | 516 ---------------
dm_auth.h | 99 --
dm_error.h | 52 -
dm_socket.h | 45 -
dpylist.c | 266 -------
error.c | 138 ----
file.c | 250 -------
genauth.c | 481 --------------
greet.h | 218 ------
greeter/Login.c | 132 +--
greeter/Login.h | 4
greeter/LoginP.h | 26
greeter/Makefile.am | 7
greeter/greet.c | 95 +-
greeter/verify.c | 22
include/Makefile.am | 6
include/dm.h | 518 +++++++++++++++
include/dm_auth.h | 99 ++
include/dm_error.h | 46 +
include/dm_socket.h | 45 +
include/greet.h | 218 ++++++
krb5auth.c | 258 -------
m4/ac_define_dir.m4 | 45 -
m4/ax_define_dir.m4 | 49 +
man/Makefile.am | 55 +
man/xdm.man | 1466 +++++++++++++++++++++++++++++++++++++++++++
man/xdmshell.man | 108 +++
mitauth.c | 93 --
netaddr.c | 272 -------
policy.c | 208 ------
prngc.c | 190 -----
protodpy.c | 164 ----
reset.c | 113 ---
resource.c | 509 --------------
rpcauth.c | 89 --
server.c | 406 -----------
session.c | 1048 ------------------------------
socket.c | 558 ----------------
streams.c | 167 ----
util.c | 310 ---------
xdm.man.cpp | 1451 ------------------------------------------
xdm.service.in | 9
xdm/.gitignore | 1
xdm/Makefile.am | 79 ++
xdm/access.c | 986 ++++++++++++++++++++++++++++
xdm/auth.c | 1554 +++++++++++++++++++++++++++++++++++++++++++++
xdm/choose.c | 544 +++++++++++++++
xdm/daemon.c | 90 ++
xdm/dm.c | 1058 +++++++++++++++++++++++++++++++
xdm/dpylist.c | 266 +++++++
xdm/error.c | 136 +++
xdm/file.c | 249 +++++++
xdm/genauth.c | 481 ++++++++++++++
xdm/krb5auth.c | 256 +++++++
xdm/mitauth.c | 93 ++
xdm/netaddr.c | 272 +++++++
xdm/policy.c | 208 ++++++
xdm/prngc.c | 190 +++++
xdm/protodpy.c | 164 ++++
xdm/reset.c | 113 +++
xdm/resource.c | 511 +++++++++++++++
xdm/rpcauth.c | 89 ++
xdm/server.c | 405 +++++++++++
xdm/session.c | 1038 ++++++++++++++++++++++++++++++
xdm/socket.c | 557 ++++++++++++++++
xdm/streams.c | 167 ++++
xdm/util.c | 310 +++++++++
xdm/xdmauth.c | 284 ++++++++
xdm/xdmcp.c | 1601 +++++++++++++++++++++++++++++++++++++++++++++++
xdmauth.c | 286 --------
xdmcp.c | 1601 -----------------------------------------------
xdmshell.c | 161 ----
xdmshell/.gitignore | 1
xdmshell/Makefile.am | 23
xdmshell/xdmshell.c | 160 ++++
99 files changed, 16351 insertions(+), 16213 deletions(-)
New commits:
commit 23949f9a4c30b5dfa67a88b3dd2523f09f163d91
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date: Sun Sep 25 00:41:25 2011 -0700
configure.ac: Bump to 1.1.11
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
diff --git a/configure.ac b/configure.ac
index eded131..b488f0c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ dnl Process this file with autoconf to create configure.
# Initialize Autoconf
AC_PREREQ([2.60])
-AC_INIT([xdm], [1.1.10],
+AC_INIT([xdm], [1.1.11],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xdm])
AC_USE_SYSTEM_EXTENSIONS
AC_CONFIG_SRCDIR([Makefile.am])
commit 225493d3c6be64dafec69095f254a1bee6386e33
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Tue Sep 20 17:39:34 2011 -0700
fix whitespace issues
Performed with:
find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}'
find * -type f | xargs perl -i -p -e 's{^[ ]+\t}{\t}'
git diff -w & git diff -b show no diffs from this change
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
diff --git a/AUTHORS b/AUTHORS
index a33ed38..c5bd36b 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -7,7 +7,7 @@ Original authors credited in source files:
Later enhancements:
Alan Coopersmith, Sun Microsystems:
- IPv6 support, Solaris authentication enhancements,
+ IPv6 support, Solaris authentication enhancements,
PAM conversation rewrite
Amit Margalit, Caolan McNamara, Ivan Griffin, Matthieu Herrb:
diff --git a/COPYING b/COPYING
index 013ea7b..f72efe4 100644
--- a/COPYING
+++ b/COPYING
@@ -103,7 +103,7 @@ authorization.
------------------------------------------------------------
md5 code in genauth.c implements something close to the MD5 message-digest
-algorithm. This code is based on code written by Colin Plumb in 1993,
+algorithm. This code is based on code written by Colin Plumb in 1993,
no copyright is claimed.
This code is in the public domain; do with it what you wish.
diff --git a/config/Xaccess b/config/Xaccess
index 998e906..c843888 100644
--- a/config/Xaccess
+++ b/config/Xaccess
@@ -34,7 +34,7 @@
# The fourth form is similar to the third, except instead of using the
# broadcast address, it sends DirectQuerys to each of the hosts in the list
# The fifth form tells xdm which addresses to listen for incoming connections
-# on. If present, xdm will only listen for connections on the specified
+# on. If present, xdm will only listen for connections on the specified
# interfaces and/or multicast groups.
#
# In all cases, xdm uses the first entry which matches the terminal;
@@ -84,7 +84,7 @@
# all unicast interfaces, but not for multicast packets. If any LISTEN lines
# are specified, then only the listed interfaces will be listened on.
#
-# IANA has assigned FF0X:0:0:0:0:0:0:12B as the permanently assigned
+# IANA has assigned FF0X:0:0:0:0:0:0:12B as the permanently assigned
# multicast addresses for XDMCP, where X in the prefix may be replaced
# by any valid scope identifier, such as 1 for Node-Local, 2 for Link-Local,
# 5 for Site-Local, and so on. The default is equivalent to the example shown
diff --git a/config/Xsession.cpp b/config/Xsession.cpp
index 61b52a9..36ccbd0 100644
--- a/config/Xsession.cpp
+++ b/config/Xsession.cpp
@@ -10,14 +10,14 @@ then
else
#ifdef MKTEMP_COMMAND
mktemp=MKTEMP_COMMAND
- for errfile in "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER"
+ for errfile in "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER"
do
if ef="$( umask 077 && $mktemp "$errfile.XXXXXX" 2> /dev/null)"
then
exec > "$ef" 2>&1
mv "$ef" "$errfile" 2> /dev/null
- break
- fi
+ break
+ fi
done
#else
XCOMM Since this system doesn't have a mktemp command to allow secure
diff --git a/configure.ac b/configure.ac
index 2485288..eded131 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
dnl Copyright 2005 Red Hat, Inc.
-dnl
+dnl
dnl Permission to use, copy, modify, distribute, and sell this software and its
dnl documentation for any purpose is hereby granted without fee, provided that
dnl the above copyright notice appear in all copies and that both that
@@ -9,7 +9,7 @@ dnl advertising or publicity pertaining to distribution of the software without
dnl specific, written prior permission. Red Hat makes no
dnl representations about the suitability of this software for any purpose. It
dnl is provided "as is" without express or implied warranty.
-dnl
+dnl
dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
@@ -292,7 +292,7 @@ if test "x$WTMP_FILE" = "xyes" ; then
AC_MSG_ERROR([path was not specified to --with-wtmp-file])
fi
if test "x$WTMP_FILE" = "x" ; then
- for WTMP_FILE in /var/adm/wtmpx /var/log/wtmp /var/adm/wtmp /usr/adm/wtmp /etc/wtmp ; do
+ for WTMP_FILE in /var/adm/wtmpx /var/log/wtmp /var/adm/wtmp /usr/adm/wtmp /etc/wtmp ; do
AC_CHECK_FILE([$WTMP_FILE], [break], [WTMP_FILE=""])
done
if test "x$WTMP_FILE" = "x" ; then
@@ -315,7 +315,7 @@ AC_SUBST(SHELL_CMD)
PKG_CHECK_MODULES(XDM, xmu x11 xau)
PKG_CHECK_EXISTS(xinerama, [
- AC_DEFINE([USE_XINERAMA], 1,
+ AC_DEFINE([USE_XINERAMA], 1,
[Define to 1 to use XINERAMA in greeter & chooser])
PKG_CHECK_MODULES(XINERAMA, xinerama)
CHOOSER_CFLAGS="$CHOOSER_CFLAGS $XINERAMA_CFLAGS"
@@ -325,31 +325,31 @@ PKG_CHECK_EXISTS(xinerama, [
])
# Xft text drawing for the greeter screen
-AC_ARG_WITH(xft,
- AS_HELP_STRING([--with-xft],
+AC_ARG_WITH(xft,
+ AS_HELP_STRING([--with-xft],
[Use Xft to draw text (default is YES if installed)]),
- [USE_XFT="$withval"],
+ [USE_XFT="$withval"],
PKG_CHECK_EXISTS(xft, [USE_XFT="yes"], [USE_XFT="no"]))
if test "x$USE_XFT" = "xyes" ; then
PKG_CHECK_MODULES(XFT, xft)
GREETER_CFLAGS="$GREETER_CFLAGS $XFT_CFLAGS"
GREETER_LIBS="$GREETER_LIBS $XFT_LIBS"
- AC_DEFINE([USE_XFT], 1,
+ AC_DEFINE([USE_XFT], 1,
[Define to 1 to use Xft for text on greeter screen])
fi
# XPM logos for the greeter screen
-AC_ARG_ENABLE(xpm-logos,
- AS_HELP_STRING([--enable-xpm-logos],
+AC_ARG_ENABLE(xpm-logos,
+ AS_HELP_STRING([--enable-xpm-logos],
[Display xpm logos in greeter (default is YES)]),
- [USE_XPM="$enableval"],
+ [USE_XPM="$enableval"],
PKG_CHECK_EXISTS(xpm, [USE_XPM="yes"], [USE_XPM="no"]))
if test "x$USE_XPM" = "xyes" ; then
PKG_CHECK_MODULES(XPM, xpm)
GREETER_CFLAGS="$GREETER_CFLAGS $XPM_CFLAGS"
GREETER_LIBS="$GREETER_LIBS $XPM_LIBS"
- AC_DEFINE([XPM], 1,
+ AC_DEFINE([XPM], 1,
[Define to 1 to display XPM logos on greeter screen])
fi
AM_CONDITIONAL(USE_XPM, test "x$USE_XPM" = "xyes")
@@ -365,7 +365,7 @@ AC_ARG_WITH(bw-pixmap,
AC_ARG_WITH(pixmapdir,
AS_HELP_STRING([--with-pixmapdir=<pathname>],
[specify directory for xpm files (default=xdmlibdir/pixmaps)]),
- [XDM_PIXMAPDIR="$withval"],
+ [XDM_PIXMAPDIR="$withval"],
[XDM_PIXMAPDIR='${XDMLIBDIR}/pixmaps'])
AC_SUBST(XDM_PIXMAP)
@@ -444,10 +444,10 @@ AC_SUBST(CHOOSER_LIBS)
# Currently just trying to mirror what defaults were set in Imake
# -DDEF_SERVER_LINE=":0 local $(DEF_SERVER) :0"
-if test -z "$DEF_SERVER" ; then
+if test -z "$DEF_SERVER" ; then
DEF_SERVER="${bindir}/X"
fi
-if test -z "$DEF_SERVER_LINE" ; then
+if test -z "$DEF_SERVER_LINE" ; then
DEF_SERVER_LINE=":0 local ${DEF_SERVER} :0"
fi
AX_DEFINE_DIR(DEF_SERVER_LINE, DEF_SERVER_LINE,
diff --git a/greeter/Login.c b/greeter/Login.c
index 961f4dc..99a3932 100644
--- a/greeter/Login.c
+++ b/greeter/Login.c
@@ -162,11 +162,11 @@ static XtResource resources[] = {
#ifndef USE_XFT
{XtNfont, XtCFont, XtRFontStruct, sizeof (XFontStruct *),
- offset (textFont), XtRString, "*-new century schoolbook-medium-r-normal-*-180-*"},
+ offset (textFont), XtRString, "*-new century schoolbook-medium-r-normal-*-180-*"},
{XtNpromptFont, XtCFont, XtRFontStruct, sizeof (XFontStruct *),
- offset (promptFont), XtRString, "*-new century schoolbook-bold-r-normal-*-180-*"},
+ offset (promptFont), XtRString, "*-new century schoolbook-bold-r-normal-*-180-*"},
{XtNgreetFont, XtCFont, XtRFontStruct, sizeof (XFontStruct *),
- offset (greetFont), XtRString, "*-new century schoolbook-bold-i-normal-*-240-*"},
+ offset (greetFont), XtRString, "*-new century schoolbook-bold-i-normal-*-240-*"},
{XtNfailFont, XtCFont, XtRFontStruct, sizeof (XFontStruct *),
offset (failFont), XtRString, "*-new century schoolbook-bold-r-normal-*-180-*"},
#else /* USE_XFT */
@@ -188,7 +188,7 @@ static XtResource resources[] = {
offset(failcolor), XtRString, XtDefaultForeground},
#endif
{XtNgreeting, XtCGreeting, XtRString, sizeof (char *),
- offset(greeting), XtRString, "X Window System"},
+ offset(greeting), XtRString, "X Window System"},
{XtNunsecureGreeting, XtCGreeting, XtRString, sizeof (char *),
offset(unsecure_greet), XtRString, "This is an unsecure session"},
{XtNnamePrompt, XtCNamePrompt, XtRString, sizeof (char *),
@@ -502,21 +502,21 @@ realizeCursor (LoginWidget w, GC gc)
XFillRectangle (XtDisplay (w), XtWindow (w), gc,
x, y+1 - F_ASCENT(text), width, height-1);
XDrawPoint (XtDisplay (w), XtWindow (w), gc,
- x-1 , y - F_ASCENT(text));
+ x-1 , y - F_ASCENT(text));
XDrawPoint (XtDisplay (w), XtWindow (w), gc,
- x+1 , y - F_ASCENT(text));
+ x+1 , y - F_ASCENT(text));
XDrawPoint (XtDisplay (w), XtWindow (w), gc,
- x-1 , y - F_ASCENT(text)+height);
+ x-1 , y - F_ASCENT(text)+height);
XDrawPoint (XtDisplay (w), XtWindow (w), gc,
- x+1 , y - F_ASCENT(text)+height);
+ x+1 , y - F_ASCENT(text)+height);
XDrawPoint (XtDisplay (w), XtWindow (w), gc,
- x-2 , y - F_ASCENT(text));
+ x-2 , y - F_ASCENT(text));
XDrawPoint (XtDisplay (w), XtWindow (w), gc,
- x+2 , y - F_ASCENT(text));
+ x+2 , y - F_ASCENT(text));
XDrawPoint (XtDisplay (w), XtWindow (w), gc,
- x-2 , y - F_ASCENT(text)+height);
+ x-2 , y - F_ASCENT(text)+height);
XDrawPoint (XtDisplay (w), XtWindow (w), gc,
- x+2 , y - F_ASCENT(text)+height);
+ x+2 , y - F_ASCENT(text)+height);
XFlush (XtDisplay(w));
}
@@ -702,13 +702,13 @@ draw_it (LoginWidget w)
for(i=1;i<=(w->login.outframewidth);i++)
{
XDrawLine(XtDisplay (w), XtWindow (w), w->login.hiGC,
- i-1,i-1,w->core.width-i,i-1);
+ i-1,i-1,w->core.width-i,i-1);
XDrawLine(XtDisplay (w), XtWindow (w), w->login.hiGC,
- i-1,i-1,i-1,w->core.height-i);
+ i-1,i-1,i-1,w->core.height-i);
XDrawLine(XtDisplay (w), XtWindow (w), w->login.shdGC,
- w->core.width-i,i-1,w->core.width-i,w->core.height-i);
+ w->core.width-i,i-1,w->core.width-i,w->core.height-i);
XDrawLine(XtDisplay (w), XtWindow (w), w->login.shdGC,
- i-1,w->core.height-i,w->core.width-i,w->core.height-i);
+ i-1,w->core.height-i,w->core.width-i,w->core.height-i);
}
/* make separator line */
@@ -1718,7 +1718,7 @@ static void Initialize (
xvaluemask = valuemask;
if (w->login.greetFont == NULL)
- w->login.greetFont = w->login.textFont;
+ w->login.greetFont = w->login.textFont;
else
xvaluemask |= GCFont;
diff --git a/greeter/LoginP.h b/greeter/LoginP.h
index ef2151d..bd82ce3 100644
--- a/greeter/LoginP.h
+++ b/greeter/LoginP.h
@@ -72,12 +72,12 @@ from The Open Group.
typedef void (*LoginFunc)(LoginWidget, LoginData *, int);
typedef struct {
- char * promptText; /* Prompt displayed */
- const char * defaultPrompt; /* Default text for prompt */
- char * valueText; /* Value entered for prompt */
- size_t valueTextMax; /* Size of valueText buffer */
- int valueShownStart;/* Amount of string shown if too */
- int valueShownEnd; /* long to fit in field */
+ char * promptText; /* Prompt displayed */
+ const char * defaultPrompt; /* Default text for prompt */
+ char * valueText; /* Value entered for prompt */
+ size_t valueTextMax; /* Size of valueText buffer */
+ int valueShownStart;/* Amount of string shown if too */
+ int valueShownEnd; /* long to fit in field */
int cursor; /* current cursor position */
loginPromptState state;
} loginPromptData;
@@ -109,9 +109,9 @@ typedef struct {
char *unsecure_greet;/* message displayed when insecure */
char *namePrompt; /* name prompt */
char *passwdPrompt; /* password prompt */
- char *failMsg; /* failure message */
+ char *failMsg; /* failure message */
char *fail; /* current error message */
- char *passwdChangeMsg; /* message when passwd expires */
+ char *passwdChangeMsg; /* message when passwd expires */
# ifndef USE_XFT
XFontStruct *textFont; /* font for text */
XFontStruct *promptFont; /* font for prompts */
@@ -119,7 +119,7 @@ typedef struct {
XFontStruct *failFont; /* font for failure message */
# endif /* USE_XFT */
int state; /* state */
- int activePrompt; /* which prompt is active */
+ int activePrompt; /* which prompt is active */
int failUp; /* failure message displayed */
LoginData data; /* name/passwd */
char *sessionArg; /* argument passed to session */
@@ -136,7 +136,7 @@ typedef struct {
char * echo_passwd_char;
XIC xic; /* input method of input context */
loginPromptData prompts[NUM_PROMPTS];
- time_t msgTimeout;
+ time_t msgTimeout;
# ifdef DANCING
/*caolan begin*/
diff --git a/greeter/greet.c b/greeter/greet.c
index 87d2a83..539ce17 100644
--- a/greeter/greet.c
+++ b/greeter/greet.c
@@ -310,7 +310,7 @@ InitGreet (struct display *d)
if (d->pingInterval)
{
- pingTimeout = XtAppAddTimeOut (context, d->pingInterval * 60 * 1000,
+ pingTimeout = XtAppAddTimeOut (context, d->pingInterval * 60 * 1000,
GreetPingServer, (XtPointer) d);
}
return dpy;
diff --git a/greeter/verify.c b/greeter/verify.c
index dee035a..ea62cd2 100644
--- a/greeter/verify.c
+++ b/greeter/verify.c
@@ -389,7 +389,7 @@ Verify (struct display *d, struct greet_info *greet, struct verify_info *verify)
Debug("Not on system console\n");
if (greet->password != NULL)
bzero(greet->password, strlen(greet->password));
- free(console);
+ free(console);
return 0;
}
free(console);
commit 8016dfd9080393c23d19b1c34e81d1f544655d5a
Author: Matěj Cepl <mcepl@redhat.com>
Date: Mon Aug 8 21:26:47 2011 +0200
Use explicitly /bin/sh for running of Xwilling script via su.
su nobody -c <command> uses a default shell of the user, which in case
of nobody is (at least on Linux distros) /sbin/nologin.
Signed-off-by: Matěj Cepl <mcepl@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewd-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
diff --git a/config/xdm-config.cpp b/config/xdm-config.cpp
index 59d548b..a685129 100644
--- a/config/xdm-config.cpp
+++ b/config/xdm-config.cpp
@@ -16,7 +16,7 @@ DisplayManager.keyFile: XDMCONFIGDIR/xdm-keys
DisplayManager.servers: XDMCONFIGDIR/Xservers
DisplayManager.accessFile: XDMCONFIGDIR/Xaccess
DisplayManager*resources: XDMCONFIGDIR/Xresources
-DisplayManager.willing: SU nobody -c XDMSCRIPTDIR/Xwilling
+DisplayManager.willing: SU nobody -s /bin/sh -c XDMSCRIPTDIR/Xwilling
! All displays should use authorization, but we cannot be sure
! X terminals may not be configured that way, so they will require
! individual resource settings.
commit 0782f1c24c658c06736907dd143f8e67359ac235
Author: Michał Górny <mgorny@gentoo.org>
Date: Wed Aug 31 18:02:53 2011 +0200
Support installing systemd unit file.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=38339
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Tested-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
diff --git a/.gitignore b/.gitignore
index fbf6b92..c51052d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -76,3 +76,4 @@ core
# Edit the following section as needed
# For example, !report.pc overrides *.pc. See 'man gitignore'
#
+xdm.service
diff --git a/Makefile.am b/Makefile.am
index 0bd7ca9..e5f9f5c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,7 +24,9 @@ SUBDIRS = app-defaults chooser config greeter include man xdm xdmshell
ACLOCAL_AMFLAGS = -I m4
# This ensures distcheck is performed in a location where user has write access
-DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
+DISTCHECK_CONFIGURE_FLAGS = \
+ --with-appdefaultdir=\$${datadir}/X11/app-defaults \
+ --with-systemdsystemunitdir=\$${libdir}/systemd/system
if LINT
ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
@@ -38,6 +40,15 @@ lint:
(cd chooser && $(MAKE) $(AM_MAKEFLAGS) lint)
endif LINT
+if HAVE_SYSTEMD
+systemdsystemunit_DATA = xdm.service
+
+xdm.service: xdm.service.in
+ $(AM_V_GEN)$(SED) -e 's|BINDIR|$(bindir)|g' < $< > $@
+endif HAVE_SYSTEMD
+CLEANFILES = xdm.service
+EXTRA_DIST = xdm.service.in
+
MAINTAINERCLEANFILES = ChangeLog INSTALL
.PHONY: ChangeLog INSTALL
diff --git a/configure.ac b/configure.ac
index 0c79999..2485288 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,6 +145,27 @@ if test "x$USE_SELINUX" != "xno" ; then
)
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)]),,
+ [with_systemdsystemunitdir=auto])
+AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [
+ def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
+
+ AS_IF([test "x$def_systemdsystemunitdir" = "x"], [
+ AS_IF([test "x$with_systemdsystemunitdir" = "xyes"], [
+ AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])
+ ])
+ with_systemdsystemunitdir=no
+ ], [
+ with_systemdsystemunitdir=$def_systemdsystemunitdir
+ ])
+])
+AS_IF([test "x$with_systemdsystemunitdir" != "xno"], [
+ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+])
+AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$with_systemdsystemunitdir" != "xno"])
+
# FIXME: Find better test for which OS'es use su -m - for now, just try to
# mirror the Imakefile setting of:
# if defined(OpenBSDArchitecture) || defined(NetBSDArchitecture) || defined(FreeBSDArchitecture) || defined(DarwinArchitecture)
diff --git a/xdm.service.in b/xdm.service.in
new file mode 100644
index 0000000..d15e072
--- /dev/null
+++ b/xdm.service.in
@@ -0,0 +1,9 @@
+[Unit]
+Description=X-Window Display Manager
+After=systemd-user-sessions.service
+
+[Service]
+ExecStart=BINDIR/xdm -nodaemon
+
+[Install]
+Alias=graphical.target.wants/xdm.service
commit 5574b79c2d6c89f96484b890872ba1594fb6ddd2
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Thu Jun 2 21:52:20 2011 -0700
Simplify FailedLogin code
Relies on username going out of scope to discard the pointer returned by
pam_get_item that pam_end frees at the bottom of the loop.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
diff --git a/greeter/greet.c b/greeter/greet.c
index 8426a65..87d2a83 100644
--- a/greeter/greet.c
+++ b/greeter/greet.c
@@ -402,11 +402,9 @@ Greet (struct display *d, struct greet_info *greet)
static void
-FailedLogin (struct display *d, struct greet_info *greet)
+FailedLogin (struct display *d, const char *username)
{
#ifdef USE_SYSLOG
- const char *username = greet->name;
-
if (username == NULL)
username = "username unavailable";
@@ -415,10 +413,6 @@ FailedLogin (struct display *d, struct greet_info *greet)
d->name, username);
#endif
DrawFail (login);
-#ifndef USE_PAM
- bzero (greet->name, strlen(greet->name));
- bzero (greet->password, strlen(greet->password));
-#endif
}
_X_EXPORT
@@ -500,7 +494,6 @@ greet_user_rtn GreetUser(
struct myconv_data pcd = { d, greet, NULL };
struct pam_conv pc = { pamconv, &pcd };
const char * pam_fname;
- char * username = NULL;
const char * login_prompt;
@@ -586,12 +579,16 @@ greet_user_rtn GreetUser(
RUN_AND_CHECK_PAM_ERROR(pam_setcred,
(*pamhp, 0));
- RUN_AND_CHECK_PAM_ERROR(pam_get_item,
- (*pamhp, PAM_USER, (void *) &username));
- if (username != NULL) {
- Debug("PAM_USER: %s\n", username);
- greet->name = username;
- greet->password = NULL;
+ {
+ char *username = NULL;
+
+ RUN_AND_CHECK_PAM_ERROR(pam_get_item,
+ (*pamhp, PAM_USER, (void *) &username));
+ if (username != NULL) {
+ Debug("PAM_USER: %s\n", username);
+ greet->name = username;
+ greet->password = NULL;
+ }
}
pam_done:
@@ -606,19 +603,14 @@ greet_user_rtn GreetUser(
break;
} else {
/* Try to fill in username for failed login error log */
- if (greet->name == NULL) {
- if (username == NULL) {
- RUN_AND_CHECK_PAM_ERROR(pam_get_item,
- (*pamhp, PAM_USER,
- (void *) &username));
- }
- greet->name = username;
- }
- FailedLogin (d, greet);
- if (greet->name == username) {
- /* pam_end frees the value returned by pam_get_item */
- greet->name = NULL;
+ char *username = greet->name;
+
+ if (username == NULL) {
+ RUN_AND_CHECK_PAM_ERROR(pam_get_item,
+ (*pamhp, PAM_USER,
+ (void *) &username));
}
+ FailedLogin (d, username);
RUN_AND_CHECK_PAM_ERROR(pam_end,
(*pamhp, pam_error));
}
@@ -638,7 +630,11 @@ greet_user_rtn GreetUser(
if (Verify (d, greet, verify))
break;
else
- FailedLogin (d, greet);
+ {
+ FailedLogin (d, greet->name);
+ bzero (greet->name, strlen(greet->name));
+ bzero (greet->password, strlen(greet->password));
+ }
#endif
}
DeleteXloginResources (d, *dpy);
commit 29e9393697d0b7158c2c1e0856180713c7c8f925
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Thu Jun 2 21:39:16 2011 -0700
Stop using username retrieved from PAM before pam_end frees it.
The first time a failed login message was syslogged it had the right
username, but subsequent ones kept reusing that pointer, even though
PAM had freed it and it may have been reused and filled with something
else, resulting in garbage user names for the later login failures.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
diff --git a/greeter/greet.c b/greeter/greet.c
index 5182650..8426a65 100644
--- a/greeter/greet.c
+++ b/greeter/greet.c
@@ -615,6 +615,10 @@ greet_user_rtn GreetUser(
greet->name = username;
}
FailedLogin (d, greet);
+ if (greet->name == username) {
+ /* pam_end frees the value returned by pam_get_item */
+ greet->name = NULL;
+ }
RUN_AND_CHECK_PAM_ERROR(pam_end,
(*pamhp, pam_error));
}
commit eca379146cf487cbd05e1698ea12c1835327d1d4
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Thu Jun 2 20:46:57 2011 -0700
Add _X_ATTRIBUTE_PRINTF to LogVWrite declaration
Suggested by gcc -Wmissing-format-attribute
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
diff --git a/xdm/error.c b/xdm/error.c
index 198053f..af32ad5 100644
--- a/xdm/error.c
+++ b/xdm/error.c
@@ -43,7 +43,7 @@ from The Open Group.
#include "dm_error.h"
/* This function does the actual log message writes. */
-static inline void
+static inline void _X_ATTRIBUTE_PRINTF(1,0)
LogVWrite(const char *fmt, va_list args)
{
char buf[1024];
commit 7b8a4bb753d9da4cde60379050493d811c9b3044
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Thu Jun 2 20:45:32 2011 -0700
Replace GCC_PRINTFLIKE with xproto's _X_ATTRIBUTE_PRINTF
The existing GCC_PRINTFLIKE declaration seems to have been broken, since
it only defined GCC_PRINTFLIKE if GCC_PRINTFLIKE was already defined.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
diff --git a/include/dm_error.h b/include/dm_error.h
index 739da7b..e8a92ef 100644
--- a/include/dm_error.h
+++ b/include/dm_error.h
@@ -34,19 +34,13 @@ authorization.
#ifndef _DM_ERROR_H_
# define _DM_ERROR_H_ 1
-# if defined(GCC_PRINTFLIKE) && defined(__GNUC__)
-# define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
-# else
-# define GCC_PRINTFLIKE(fmt,var) /*nothing*/
-# endif
-
-extern void Debug (const char * fmt, ...) GCC_PRINTFLIKE(1,2);
+extern void Debug (const char * fmt, ...) _X_ATTRIBUTE_PRINTF(1,2);
extern void InitErrorLog (void);
-extern void LogAppend (const char * fmt, ...) GCC_PRINTFLIKE(1,2);
-extern void LogError (const char * fmt, ...) GCC_PRINTFLIKE(1,2);
-extern void LogInfo (const char * fmt, ...) GCC_PRINTFLIKE(1,2);
-extern void LogOutOfMem (const char * fmt, ...) GCC_PRINTFLIKE(1,2);
-extern void LogPanic (const char * fmt, ...) GCC_PRINTFLIKE(1,2);
+extern void LogAppend (const char * fmt, ...) _X_ATTRIBUTE_PRINTF(1,2);
+extern void LogError (const char * fmt, ...) _X_ATTRIBUTE_PRINTF(1,2);
+extern void LogInfo (const char * fmt, ...) _X_ATTRIBUTE_PRINTF(1,2);
+extern void LogOutOfMem (const char * fmt, ...) _X_ATTRIBUTE_PRINTF(1,2);
+extern void LogPanic (const char * fmt, ...) _X_ATTRIBUTE_PRINTF(1,2);
#endif /* _DM_ERROR_H_ */
commit 7843f1e00caba67025ac75c4985ddd3af7924a9c
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Thu Jun 2 20:38:29 2011 -0700
Use C99 named initializers for XSetWindowAttributes structure
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
diff --git a/greeter/Login.c b/greeter/Login.c
index 90b72fc..961f4dc 100644
--- a/greeter/Login.c
+++ b/greeter/Login.c
@@ -1892,10 +1892,10 @@ static void Realize (
* Create pixmap window
*/
{
- XSetWindowAttributes windowAttributes = { 0 };
-
- windowAttributes.background_pixel = w->core.background_pixel;
- windowAttributes.background_pixmap = None;
+ XSetWindowAttributes windowAttributes = {
+ .background_pixel = w->core.background_pixel,
+ .background_pixmap = None
+ };
w->login.logoWindow = XCreateWindow(XtDisplay(w),
XtWindow(w),
commit 3c3f9cde9dda4c74178cc5428ebf8967c26a516a
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Thu Jun 2 18:33:56 2011 -0700
Bug 13455: allowNullPasswd: true doesn't work until the second login attempt
Assign allow_null_passwd and allow_root_login variables' values before call to
pam_authenticate()
https://bugs.freedesktop.org/show_bug.cgi?id=13455
Based on a fix suggested by: Tim Shumakov <ars_1@mail.ru>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
diff --git a/greeter/greet.c b/greeter/greet.c
index 8e32279..5182650 100644
--- a/greeter/greet.c
+++ b/greeter/greet.c
@@ -351,7 +351,7 @@ static int
Greet (struct display *d, struct greet_info *greet)
{
XEvent event;
- Arg arglist[3];
+ Arg arglist[1];
XtSetArg (arglist[0], XtNallowAccess, False);
XtSetValues (login, arglist, 1);
@@ -394,9 +394,7 @@ Greet (struct display *d, struct greet_info *greet)
greet->password = password;
#endif /* USE_PAM */
XtSetArg (arglist[0], XtNsessionArgument, (char *) &(greet->string));
- XtSetArg (arglist[1], XtNallowNullPasswd, (char *) &(greet->allow_null_passwd));
- XtSetArg (arglist[2], XtNallowRootLogin, (char *) &(greet->allow_root_login));
- XtGetValues (login, arglist, 3);
+ XtGetValues (login, arglist, 1);
Debug ("sessionArgument: %s\n", greet->string ? greet->string : "<NULL>");
}
return code;
@@ -432,6 +430,7 @@ greet_user_rtn GreetUser(
struct dlfuncs *dlfuncs)
{
int i;
+ Arg arglist[2];
/*
* These must be set before they are used.
@@ -485,6 +484,12 @@ greet_user_rtn GreetUser(
exit (RESERVER_DISPLAY);
}
+ XtSetArg (arglist[0], XtNallowNullPasswd,
+ (char *) &(greet->allow_null_passwd));
+ XtSetArg (arglist[1], XtNallowRootLogin,
+ (char *) &(greet->allow_root_login));
+ XtGetValues (login, arglist, 2);
+
for (;;) {
#ifdef USE_PAM
commit 7d69ff7b9dfcd3e4410f181225f66f51089eef67
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri May 27 22:46:09 2011 -0700
On Solaris, make sure PAM_TTY is only ever set to an actual /dev path
Solaris PAM & auditing insist this is a device file that can be found in
the filesystem, so we can't use the display name (":0") like we've
been doing (and continue to do on other OS'es).
Fixes Solaris bug 6960231:
xdm login fails with: pam_unix_cred: cannot load ttyname with c2audit loaded
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
diff --git a/greeter/greet.c b/greeter/greet.c
index 0639e76..8e32279 100644
--- a/greeter/greet.c
+++ b/greeter/greet.c
@@ -537,8 +537,25 @@ greet_user_rtn GreetUser(
(*pamhp, PAM_RHOST, hostname));
free(hostname);
}
- } else
- RUN_AND_CHECK_PAM_ERROR(pam_set_item, (*pamhp, PAM_TTY, d->name));
+ } else { /* Displaying on local host */
+ const char *ttyname = NULL;
+
+#ifdef __sun
+ /* Solaris PAM & auditing insist this is a device file that can
+ be found under /dev, so we can't use the display name */
+ char vtpath[16];
+
+ if ((d->windowPath) && !(strchr(d->windowPath, ':'))) {
+ /* if path is simply a VT, with no intermediaries, use it */
+ snprintf(vtpath, sizeof(vtpath), "/dev/vt/%s", d->windowPath);
+ ttyname = vtpath;
+ }
+#else
+ /* On all other OS'es we just pass the display name for PAM_TTY */
+ ttyname = d->name;
+#endif
+ RUN_AND_CHECK_PAM_ERROR(pam_set_item, (*pamhp, PAM_TTY, ttyname));
+ }
if (!greet->allow_null_passwd) {
pam_flags |= PAM_DISALLOW_NULL_AUTHTOK;
commit 68517be0c7ae67989bc3cd845c8aa79ef7040618
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Tue May 17 19:37:15 2011 -0700
xdm.man: address only needs 2 S's, not 3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
diff --git a/man/xdm.man b/man/xdm.man
index acb710b..9590c1a 100644
--- a/man/xdm.man
+++ b/man/xdm.man
@@ -769,7 +769,7 @@ to the chosen host, which starts a session on that display.
The following configuration directive is also defined for the Xaccess
configuration file:
.IP "\fBLISTEN\fP \fIinterface\fP \fI[list of multicast group addresses]\fP"
-\fIinterface\fP may be a hostname or IP addresss representing a
+\fIinterface\fP may be a hostname or IP address representing a
network interface on this machine, or the wildcard * to represent all
available network interfaces.
.PP
commit bd0acffc9e69c4ca39d0881984ae587ad4385934
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat May 14 10:08:25 2011 -0700
freeifaddrs() when done with it in DefineSelf()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
diff --git a/xdm/auth.c b/xdm/auth.c
index 8b6e1ec..bbca167 100644
--- a/xdm/auth.c
+++ b/xdm/auth.c
@@ -851,6 +851,7 @@ DefineSelf(int fd, FILE *file, Xauth *auth)
# endif
writeAddr(family, len, addr, file, auth);
}
+ freeifaddrs(ifap);
Debug("DefineSelf done\n");
}
#else /* GETIFADDRS */
commit 96362c12ccd08fcb50f697106622d0c0f8a6007a
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat May 14 09:39:21 2011 -0700
Add Solaris 11 libsocket to list of libraries to search for getifaddrs()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Gaetan Nadon <memsize@videotron.ca>
Reply to: