Commit e2bf2da7 authored by William Jon McCann's avatar William Jon McCann Committed by William Jon McCann

Remove some more obsolete code. Move common code with unknown copyright

2007-10-04  William Jon McCann  <mccann@jhu.edu>

	* common/Makefile.am:
	* common/gdm-common-unknown-origin.c: (gdm_sigchld_block_push),
	(gdm_sigchld_block_pop), (gdm_sigterm_block_push),
	(gdm_sigterm_block_pop), (gdm_sigusr2_block_push),
	(gdm_sigusr2_block_pop), (gdm_safe_fopen_w), (ve_clearenv):
	* common/gdm-common-unknown-origin.h:
	* common/gdm-common.c:
	* common/gdm-common.h:
	* config/Makefile.am:
	* config/XKeepsCrashing:
	* config/default.desktop.in:
	* config/extract-shell.sh:
	* config/gdmprefetchlist.in:
	* config/gettextfoo.h:
	* config/locale.alias:
	* config/ssh.desktop.in.in:
	* configure.ac:
	* daemon/Makefile.am:
	* daemon/choose.c:
	* daemon/choose.h:
	* daemon/gdm-xdmcp-display-factory.c:
	(gdm_xdmcp_handle_indirect_query), (gdm_xdmcp_handle_manage),
	(gdm_xdmcp_handle_managed_forward):
	* daemon/main.c: (delete_pid):
	* utils/Makefile.am:
	* utils/gdm-dmx-reconnect-proxy.c:
	Remove some more obsolete code.  Move common
	code with unknown copyright status into separate file.
	Try to identify more copy with unknown copyright status.


svn path=/branches/mccann-gobject/; revision=5340
parent 14333ef1
2007-10-04 William Jon McCann <mccann@jhu.edu>
* common/Makefile.am:
* common/gdm-common-unknown-origin.c: (gdm_sigchld_block_push),
(gdm_sigchld_block_pop), (gdm_sigterm_block_push),
(gdm_sigterm_block_pop), (gdm_sigusr2_block_push),
(gdm_sigusr2_block_pop), (gdm_safe_fopen_w), (ve_clearenv):
* common/gdm-common-unknown-origin.h:
* common/gdm-common.c:
* common/gdm-common.h:
* config/Makefile.am:
* config/XKeepsCrashing:
* config/default.desktop.in:
* config/extract-shell.sh:
* config/gdmprefetchlist.in:
* config/gettextfoo.h:
* config/locale.alias:
* config/ssh.desktop.in.in:
* configure.ac:
* daemon/Makefile.am:
* daemon/choose.c:
* daemon/choose.h:
* daemon/gdm-xdmcp-display-factory.c:
(gdm_xdmcp_handle_indirect_query), (gdm_xdmcp_handle_manage),
(gdm_xdmcp_handle_managed_forward):
* daemon/main.c: (delete_pid):
* utils/Makefile.am:
* utils/gdm-dmx-reconnect-proxy.c:
Remove some more obsolete code. Move common
code with unknown copyright status into separate file.
Try to identify more copy with unknown copyright status.
2007-10-04 William Jon McCann <mccann@jhu.edu>
* common/Makefile.am:
......
......@@ -51,6 +51,8 @@ libgdmcommon_la_SOURCES = \
gdm-marshal.h \
gdm-common.h \
gdm-common.c \
gdm-common-unknown-origin.h \
gdm-common-unknown-origin.c \
gdm-settings.c \
gdm-settings.h \
gdm-settings-backend.c \
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* (c) 2000 Eazel, Inc.
* (c) 2001,2002 George Lebl
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <locale.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <setjmp.h>
#include <dirent.h>
#ifdef HAVE_CRT_EXTERNS_H
#include <crt_externs.h>
#endif
#include <glib.h>
#include <glib/gi18n.h>
#include "gdm-common.h"
static int sigchld_blocked = 0;
static sigset_t sigchldblock_mask, sigchldblock_oldmask;
static int sigterm_blocked = 0;
static sigset_t sigtermblock_mask, sigtermblock_oldmask;
static int sigusr2_blocked = 0;
static sigset_t sigusr2block_mask, sigusr2block_oldmask;
void
gdm_sigchld_block_push (void)
{
sigchld_blocked++;
if (sigchld_blocked == 1) {
/* Set signal mask */
sigemptyset (&sigchldblock_mask);
sigaddset (&sigchldblock_mask, SIGCHLD);
sigprocmask (SIG_BLOCK, &sigchldblock_mask, &sigchldblock_oldmask);
}
}
void
gdm_sigchld_block_pop (void)
{
sigchld_blocked --;
if (sigchld_blocked == 0) {
/* Reset signal mask back */
sigprocmask (SIG_SETMASK, &sigchldblock_oldmask, NULL);
}
}
void
gdm_sigterm_block_push (void)
{
sigterm_blocked++;
if (sigterm_blocked == 1) {
/* Set signal mask */
sigemptyset (&sigtermblock_mask);
sigaddset (&sigtermblock_mask, SIGTERM);
sigaddset (&sigtermblock_mask, SIGINT);
sigaddset (&sigtermblock_mask, SIGHUP);
sigprocmask (SIG_BLOCK, &sigtermblock_mask, &sigtermblock_oldmask);
}
}
void
gdm_sigterm_block_pop (void)
{
sigterm_blocked --;
if (sigterm_blocked == 0) {
/* Reset signal mask back */
sigprocmask (SIG_SETMASK, &sigtermblock_oldmask, NULL);
}
}
void
gdm_sigusr2_block_push (void)
{
sigset_t oldmask;
if (sigusr2_blocked == 0) {
/* Set signal mask */
sigemptyset (&sigusr2block_mask);
sigaddset (&sigusr2block_mask, SIGUSR2);
sigprocmask (SIG_BLOCK, &sigusr2block_mask, &oldmask);
}
sigusr2_blocked++;
sigusr2block_oldmask = oldmask;
}
void
gdm_sigusr2_block_pop (void)
{
sigset_t oldmask;
oldmask = sigusr2block_oldmask;
sigusr2_blocked--;
if (sigusr2_blocked == 0) {
/* Reset signal mask back */
sigprocmask (SIG_SETMASK, &sigusr2block_oldmask, NULL);
}
}
/* Like fopen with "w" */
FILE *
gdm_safe_fopen_w (const char *file,
mode_t perm)
{
int fd;
FILE *ret;
VE_IGNORE_EINTR (g_unlink (file));
do {
int flags;
errno = 0;
flags = O_EXCL | O_CREAT | O_TRUNC | O_WRONLY;
#ifdef O_NOCTTY
flags |= O_NOCTTY;
#endif
#ifdef O_NOFOLLOW
flags |= O_NOFOLLOW;
#endif
fd = g_open (file, flags, perm);
} while (errno == EINTR);
if (fd < 0) {
return NULL;
}
ret = fdopen (fd, "w");
return ret;
}
/**
* ve_clearenv:
*
* Description: Clears out the environment completely.
* In case there is no native implementation of clearenv,
* this could cause leaks depending on the implementation
* of environment.
*
**/
void
ve_clearenv (void)
{
#ifdef HAVE_CLEARENV
clearenv ();
#else
#ifdef HAVE__NSGETENVIRON
#define environ (*_NSGetEnviron())
#else
extern char **environ;
#endif
if (environ != NULL)
environ[0] = NULL;
#endif
}
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* (c) 2000 Eazel, Inc.
* (c) 2001,2002 George Lebl
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef _GDM_COMMON_UNKNOWN_H
#define _GDM_COMMON_UNKNOWN_H
#include <glib.h>
#include <glib/gstdio.h>
#include <time.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
G_BEGIN_DECLS
#define VE_IGNORE_EINTR(expr) \
do { \
errno = 0; \
expr; \
} while G_UNLIKELY (errno == EINTR);
#define NEVER_FAILS_seteuid(uid) \
{ int r = 0; \
if (geteuid () != uid) \
r = seteuid (uid); \
if G_UNLIKELY (r != 0) \
g_error ("GDM file %s: line %d (%s): Cannot run seteuid to %d: %s", \
__FILE__, \
__LINE__, \
G_GNUC_PRETTY_FUNCTION, \
(int)uid, \
strerror (errno)); }
#define NEVER_FAILS_setegid(gid) \
{ int r = 0; \
if (getegid () != gid) \
r = setegid (gid); \
if G_UNLIKELY (r != 0) \
g_error ("GDM file %s: line %d (%s): Cannot run setegid to %d: %s", \
__FILE__, \
__LINE__, \
G_GNUC_PRETTY_FUNCTION, \
(int)gid, \
strerror (errno)); }
/* first goes to euid-root and then sets the egid and euid, to make sure
* this succeeds */
#define NEVER_FAILS_root_set_euid_egid(uid,gid) \
{ NEVER_FAILS_seteuid (0); \
NEVER_FAILS_setegid (gid); \
if (uid != 0) { NEVER_FAILS_seteuid (uid); } }
/* like fopen with "w" but unlinks and uses O_EXCL */
FILE * gdm_safe_fopen_w (const char *file,
mode_t perm);
/* This is for race free forks */
void gdm_sigchld_block_push (void);
void gdm_sigchld_block_pop (void);
void gdm_sigterm_block_push (void);
void gdm_sigterm_block_pop (void);
void gdm_sigusr2_block_push (void);
void gdm_sigusr2_block_pop (void);
void ve_clearenv (void);
G_END_DECLS
#endif /* _GDM_COMMON_UNKNOWN_H */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* (c) 2000 Eazel, Inc.
* (c) 2001,2002 George Lebl
* Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
*
* This library is free software; you can redistribute it and/or
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* (c) 2000 Eazel, Inc.
* (c) 2001,2002 George Lebl
* Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
*
* This library is free software; you can redistribute it and/or
......@@ -24,78 +22,24 @@
#define _GDM_COMMON_H
#include <glib.h>
#include <glib/gstdio.h>
#include <time.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
G_BEGIN_DECLS
#define VE_IGNORE_EINTR(expr) \
do { \
errno = 0; \
expr; \
} while G_UNLIKELY (errno == EINTR);
#define NEVER_FAILS_seteuid(uid) \
{ int r = 0; \
if (geteuid () != uid) \
r = seteuid (uid); \
if G_UNLIKELY (r != 0) \
g_error ("GDM file %s: line %d (%s): Cannot run seteuid to %d: %s", \
__FILE__, \
__LINE__, \
G_GNUC_PRETTY_FUNCTION, \
(int)uid, \
strerror (errno)); }
#define NEVER_FAILS_setegid(gid) \
{ int r = 0; \
if (getegid () != gid) \
r = setegid (gid); \
if G_UNLIKELY (r != 0) \
g_error ("GDM file %s: line %d (%s): Cannot run setegid to %d: %s", \
__FILE__, \
__LINE__, \
G_GNUC_PRETTY_FUNCTION, \
(int)gid, \
strerror (errno)); }
/* first goes to euid-root and then sets the egid and euid, to make sure
* this succeeds */
#define NEVER_FAILS_root_set_euid_egid(uid,gid) \
{ NEVER_FAILS_seteuid (0); \
NEVER_FAILS_setegid (gid); \
if (uid != 0) { NEVER_FAILS_seteuid (uid); } }
#include "gdm-common-unknown-origin.h"
/* like fopen with "w" but unlinks and uses O_EXCL */
FILE * gdm_safe_fopen_w (const char *file,
mode_t perm);
/* This is for race free forks */
void gdm_sigchld_block_push (void);
void gdm_sigchld_block_pop (void);
void gdm_sigterm_block_push (void);
void gdm_sigterm_block_pop (void);
void gdm_sigusr2_block_push (void);
void gdm_sigusr2_block_pop (void);
void ve_clearenv (void);
G_BEGIN_DECLS
gboolean gdm_generate_random_bytes (GString *str,
int n_bytes);
gboolean gdm_string_hex_encode (const GString *source,
int start,
GString *dest,
int insert_at);
gboolean gdm_string_hex_decode (const GString *source,
int start,
int *end_return,
GString *dest,
int insert_at);
gboolean gdm_generate_cookie (GString *result);
gboolean gdm_string_hex_encode (const GString *source,
int start,
GString *dest,
int insert_at);
gboolean gdm_string_hex_decode (const GString *source,
int start,
int *end_return,
GString *dest,
int insert_at);
gboolean gdm_generate_cookie (GString *result);
G_END_DECLS
......
......@@ -17,40 +17,25 @@ noinst_DATA = \
gdm.conf \
$(NULL)
DESKTOP_FILES = \
default.desktop \
$(NULL)
EXTRA_DIST = \
gdm.conf.in \
gdm.conf-custom.in \
$(DESKTOP_FILES) \
default.desktop.in \
ssh.desktop.in.in \
Xsession.in \
gdm \
gdm-autologin \
locale.alias \
Init.in \
PreSession.in \
PostSession.in \
PostLogin \
XKeepsCrashing \
gettextfoo.h \
gdmprefetchlist.in \
extract-shell.sh \
$(NULL)
CLEANFILES = \
Xsession \
gdm.conf \
gdm.conf-custom \
default.desktop \
ssh.desktop \
Init \
PreSession \
PostSession \
gdmprefetchlist \
$(NULL)
Xsession: $(srcdir)/Xsession.in
......@@ -59,8 +44,7 @@ Xsession: $(srcdir)/Xsession.in
<$(srcdir)/Xsession.in >Xsession
gdm.conf: $(srcdir)/gdm.conf.in
sed -e 's,[@]GDMPREFETCHCMD[@],$(GDMPREFETCHCMD),g' \
-e 's,[@]GDM_CUSTOM_CONF[@],$(GDM_CUSTOM_CONF),g' \
sed -e 's,[@]GDM_CUSTOM_CONF[@],$(GDM_CUSTOM_CONF),g' \
-e 's,[@]GDM_USER_PATH[@],$(GDM_USER_PATH),g' \
-e 's,[@]HALT_COMMAND[@],$(HALT_COMMAND),g' \
-e 's,[@]REBOOT_COMMAND[@],$(REBOOT_COMMAND),g' \
......@@ -90,32 +74,20 @@ gdm.conf-custom: $(srcdir)/gdm.conf-custom.in
sed -e 's,[@]GDM_DEFAULTS_CONF[@],$(GDM_DEFAULTS_CONF),g' \
<$(srcdir)/gdm.conf-custom.in >gdm.conf-custom
gettextfoo.h: XKeepsCrashing Xsession.in
cat $^ | $(srcdir)/extract-shell.sh > gettextfoo.h
@INTLTOOL_DESKTOP_RULE@
clean-local:
rm -f $(DESKTOP_FILES)
uninstall-hook:
rm -f \
$(DESTDIR)$(bisessdir)/default.desktop \
$(DESTDIR)$(instsessdir)/default.desktop \
$(DESTDIR)$(instsessdir)/ssh.desktop \
$(DESTDIR)$(GDM_DEFAULTS_CONF) \
$(DESTDIR)$(GDM_CUSTOM_CONF) \
`dirname $(DESTDIR)$(GDM_DEFAULTS_CONF)`/factory-`basename $(DESTDIR)$(GDM_DEFAULTS_CONF)` \
$(DESTDIR)$(confdir)/XKeepsCrashing \
$(DESTDIR)$(confdir)/Xsession \
$(DESTDIR)$(confdir)/gdmprefetchlist \
$(DESTDIR)$(gdmlocaledir)/locale.alias \
$(DESTDIR)$(initdir)/Default \
$(DESTDIR)$(postlogindir)/Default.sample \
$(DESTDIR)$(predir)/Default \
$(DESTDIR)$(postdir)/Default
install-data-hook: gdm.conf gdm.conf-custom Xsession Init PostSession PreSession $(DESKTOP_FILES) $(GDMPREFETCHLIST)
install-data-hook: gdm.conf gdm.conf-custom Xsession Init PostSession PreSession
if test '!' -d $(DESTDIR)$(confdir); then \
$(mkinstalldirs) $(DESTDIR)$(confdir); \
chmod 755 $(DESTDIR)$(confdir); \
......@@ -149,14 +121,8 @@ install-data-hook: gdm.conf gdm.conf-custom Xsession Init PostSession PreSession
fi
$(INSTALL_DATA) gdm.conf `dirname $(DESTDIR)$(GDM_DEFAULTS_CONF)`/factory-`basename $(DESTDIR)$(GDM_DEFAULTS_CONF)`
$(INSTALL_SCRIPT) $(srcdir)/XKeepsCrashing $(DESTDIR)$(confdir)/XKeepsCrashing
$(INSTALL_SCRIPT) Xsession $(DESTDIR)$(confdir)/Xsession
-if test -f $(DESTDIR)$(gdmlocaledir)/locale.alias; then \
cp -f $(DESTDIR)$(gdmlocaledir)/locale.alias $(DESTDIR)$(gdmlocaledir)/locale.alias.orig; \
fi
$(INSTALL_DATA) $(srcdir)/locale.alias $(DESTDIR)$(gdmlocaledir)/locale.alias
if test '!' -d $(DESTDIR)$(bisessdir); then \
$(mkinstalldirs) $(DESTDIR)$(bisessdir); \
chmod 755 $(DESTDIR)$(bisessdir); \
......@@ -167,15 +133,6 @@ install-data-hook: gdm.conf gdm.conf-custom Xsession Init PostSession PreSession
chmod 755 $(DESTDIR)$(instsessdir); \
fi
-if test -f $(DESTDIR)$(bisessdir)/Default.desktop; then \
mv -f $(DESTDIR)$(bisessdir)/Default.desktop $(DESTDIR)$(bisessdir)/Default.desktop.orig; \
fi
-if test -f $(DESTDIR)$(bisessdir)/default.desktop; then \
cp -f $(DESTDIR)$(bisessdir)/default.desktop $(DESTDIR)$(bisessdir)/default.desktop.orig; \
fi
$(INSTALL_DATA) default.desktop $(DESTDIR)$(bisessdir)/default.desktop
chmod 644 $(DESTDIR)$(bisessdir)/default.desktop
if test '!' -d $(DESTDIR)$(initdir); then \
$(mkinstalldirs) $(DESTDIR)$(initdir); \
chmod 755 $(DESTDIR)$(initdir); \
......@@ -243,15 +200,3 @@ install-data-hook: gdm.conf gdm.conf-custom Xsession Init PostSession PreSession
fi; \
fi
if test "x$(GDMPREFETCHLIST)" != "x"; then \
$(INSTALL_DATA) gdmprefetchlist $(DESTDIR)$(confdir)/gdmprefetchlist; \
fi
if test "x$(SSHDESKTOP)" != "x"; then \
if test -f $(DESTDIR)$(instsessdir)/ssh.desktop; then \
cp -f $(DESTDIR)$(instsessdir)/ssh.desktop $(DESTDIR)$(instsessdir)/ssh.desktop.orig; \
fi; \
$(INSTALL_SCRIPT) ssh.desktop $(DESTDIR)$(instsessdir)/ssh.desktop; \
chmod 644 $(DESTDIR)$(instsessdir)/ssh.desktop; \
fi
#!/bin/sh
if test "x$UNSAFE_TO_TRANSLATE" = "xyes" ; then
LANG=C
unset LC_ALL
unset LC_MESSAGES
fi
if test -x "$LIBEXECDIR/gdmtranslate" ; then
GDMTRANSLATE="$LIBEXECDIR/gdmtranslate"
else
GDMTRANSLATE=
fi
gettextfunc () {
if test "x$GDMTRANSLATE" != "x" ; then
"$GDMTRANSLATE" "$1"
else
echo "$1"
fi
}
OLD_IFS=$IFS
gdmwhich () {
COMMAND="$1"
OUTPUT=
IFS=:
for dir in $PATH
do
if test -x "$dir/$COMMAND" ; then
if test "x$OUTPUT" = "x" ; then
OUTPUT="$dir/$COMMAND"
fi
fi
done
IFS=$OLD_IFS
echo "$OUTPUT"
}
MSG3=`gettextfunc "Failed to start the X server (your graphical interface). It is likely that it is not set up correctly. You will need to log in on a console and reconfigure the X server. Then restart GDM."`
MSG4=`gettextfunc "Would you like to try to configure the X server? Note that you will need the root password for this."`
MSG5=`gettextfunc "Please type in the root (privileged user) password."`
MSG6=`gettextfunc "Trying to restart the X server."`
MSG7=`gettextfunc "The X server is now disabled. Restart GDM when it is configured correctly."`
MSG8=`gettextfunc "Failed to start the X server (your graphical interface). It is likely that it is not set up correctly. Would you like to view the X server output to diagnose the problem?"`
MSG9=`gettextfunc "Would you like to view the detailed X server output as well?"`
# there are some env vars defined:
# XLOG = the log file for the X server
# BINDIR = location of gdm binaries
# SBINDIR = location of gdm system binaries
# LIBEXECDIR = location of gdm libexec binaries (gdmaskpass, gdmopen)
# return values are
# 0 = try again, runs this server again
# 1 = abort this display, removes this server from the list
# 32 = something went very wrong, things will just get logged.
# this means this script didnt work so do alternative things
# to tell the user if possible
#
# First see if we can find an X configuration program
# (first one in the list will be used)
#
XCONFIGURATOR=
for n in \
/usr/bin/system-config-display \
/usr/bin/redhat-config-xfree86 \
/usr/sbin/XFdrake \
/usr/bin/X11/XF86Setup \
/usr/bin/X11/Xconfigurator \
/usr/bin/X11/xf86cfg \
; do
# standard shell test has no or and loops have no breaks, eek
if test "x$XCONFIGURATOR" = "x" ; then
if test -x "$n" ; then
XCONFIGURATOR="$n"
fi
fi
done
#
# Now we check for dialog and gdmaskpass
#
DIALOG=`gdmwhich dialog`
if test "x$DIALOG" = "x" ; then
DIALOG=`gdmwhich whiptail`
fi
if test -x "$LIBEXECDIR/gdmaskpass" ; then
ASKPASS="$LIBEXECDIR/gdmaskpass"
else
ASKPASS=
fi
#
# If this is a mouse problem try mouseconfig and modify some
# messages
#
if grep '^\(Cannot open mouse\|No core pointer\)' "$XLOG" 2> /dev/null ; then
MSG8=`gettextfunc "Failed to start the X server (your graphical interface). It seems that the pointer device (your mouse) is not set up correctly. Would you like to view the X server output to diagnose the problem?"`
if test -x /usr/sbin/mouseconfig ; then
XCONFIGURATOR=/usr/sbin/mouseconfig
# Note: we know this is a mouse problem and yay we have mouseconfig
MSG4=`gettextfunc "Would you like to try to configure the mouse? Note that you will need the root password for this."`
fi
if test -x /usr/bin/system-config-mouse ; then
XCONFIGURATOR=/usr/bin/system-config-mouse
# Note: we know this is a mouse problem and yay we have system-config-mouse
MSG4=`gettextfunc "Would you like to try to configure the mouse? Note that you will need the root password for this."`
fi
fi
# we require 'gdmopen', to open a console, because we really dont
# have one. Perhaps someone should try to figure out some shell
# black magic to get this to work on other then linux systems
if test ! -x "$LIBEXECDIR/gdmopen" ; then
exit 32
fi
# when we run ourselves from the open we will pass a -noopen argument
if test "x$1" = "x-noopen" ; then
shift
else
#
# We do a lot of work wastefully over again, but oh well,
# perhaps this needs fixing.
#
"$LIBEXECDIR/gdmopen" -l /bin/sh -c "$0 -noopen $@"
exit $?
fi
clear
# Note, dialog required, though this script could be fixed to not require it
# I suppose
if test "x" = "x$DIALOG" ; then
echo =======================================================================
echo
cat "$XLOG"
echo
echo =======================================================================
echo
if test -x /usr/bin/fmt ; then
echo "$MSG3" | /usr/bin/fmt
else
echo "$MSG3"
fi
echo
echo =======================================================================
read
exit 1
fi
if "$DIALOG" --yesno "$MSG8" 10 50 ; then
"$DIALOG" --textbox "$XLOG" 22 76
# Support XFree86 v4 logfile thingie
if grep '^(..) Log file: "' "$XLOG" 2> /dev/null ; then
XLOG_DETAIL=`grep '^(..) Log file: "' "$XLOG" | sed 's/^[^"]*"\([^"]*\)".*$/\1/'`
if "$DIALOG" --yesno "$MSG9" 10 50 ; then
"$DIALOG" --textbox "$XLOG_DETAIL" 22 76
fi
fi
fi
if test "x$XCONFIGURATOR" = "x" ; then
"$DIALOG" --msgbox "$MSG7" 8 50
exit 1
fi
if "$DIALOG" --yesno "$MSG4" 10 50 ; then
clear
echo
echo "$MSG5"
if test "x$ASKPASS" = "x" ; then
# dirty trick to fool su into asking the root password even if were
# root
su nobody -c "su -c $XCONFIGURATOR"
else
if "$ASKPASS" ; then
"$XCONFIGURATOR"
fi
fi
clear
"$DIALOG" --msgbox "$MSG6" 8 50
exit 0
else