[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#402087: xdm: "no home directory" test for Xstartup



Brice Goglin wrote:
http://git.debian.org/?p=pkg-xorg/app/xdm.git;a=blob;h=7e775a3de2fe86d8011f5f5d22ee006e8dba1739;hb=dd2c9398e08e8539d82533207a5eddfffa4ea694;f=debian/local/Xstartup

Thanks. Hmm, I suspect that the lines that I described were actually ones that I added in an earlier attempt to make this work - sorry. Anyway, when I investigated this at the start of December I did understand it all and got it working correctly, and I'd like to encourage you use the Xstartup file below which files the following problems:

1. A "no home directory" message is displayed (this bug).

2. /etc/nologin works with the /etc/nologin message being displayed, rather than simply displaying "login incorrect" as currently happens. (bug #118677). For this to work you also need to prevent PAM from doing the nologin test itself; see my comment in bug #118677 where I point out which line to remove.

Xstartup file follows.


#!/bin/sh
#
# $Id: Xstartup 189 2005-06-11 00:04:27Z branden $
#
# This script is run as root after the user logs in. If this script exits with
# a return code other than 0, the user's session will not be started.

PATH="$PATH:/usr/bin/X11"

if [ -e /etc/nologin ]; then
  # always display the nologin message, if possible
  if [ -s /etc/nologin ] && which xmessage > /dev/null 2>&1; then
    xmessage -file /etc/nologin -geometry 640x480
  fi
  if [ "$(id -u $USER)" != "0" ] && \
     ! grep -qs '^ignore-nologin' /etc/X11/xdm/xdm.options; then
    exit 1
  fi
fi

# Warn if the user's home directory does not exist.
# It seems that $HOME is set to / after this script
# is executed, so we can't just compare $HOME with ~$USER.
if [ ! -d `eval echo ~$USER` ]
then
  xmessage "Home directory does not exist!"
fi

# Insert a utmp entry for the session.
if grep -qs '^use-sessreg' /etc/X11/xdm/xdm.options \
  && which sessreg >/dev/null 2>&1; then
    exec sessreg -a -l "$DISPLAY" -u /var/run/utmp \
                 -x /etc/X11/xdm/Xservers "$USER"
  # NOTREACHED
fi

exit 0

# vim:set ai et sts=2 sw=2 tw=0:








Reply to: