#! /bin/sh
# Xreset - run as root after session exits

# Reassign ownership of the console to root, this should disallow
# assignment of console output to any random users's xterm. See Xstartup.
#
#chown root /dev/console
#chmod 622 /dev/console

if grep -qs '^use-sessreg' /etc/trinity/tdm/tdm.options && \
   which sessreg > /dev/null 2>&1; then
      exec sessreg -d -l "$DISPLAY" -u /var/run/utmp \
                   -h "`echo $DISPLAY | cut -d: -f1`" "$USER"
      # NOTREACHED
fi
