summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorWilliam Jon McCann <mccann@jhu.edu>2007-10-04 21:42:29 +0000
committerWilliam Jon McCann <mccann@src.gnome.org>2007-10-04 21:42:29 +0000
commit14333ef1ffc4d2c5b162d2631c52ab71d88a2641 (patch)
tree3035ae1a2d72a71eda144c7d8e2b91c35e837337 /utils
parentdae89542cc21cd03bb0debe651b3e30b84289478 (diff)
downloadgdm-14333ef1ffc4d2c5b162d2631c52ab71d88a2641.tar.gz
Remove lots of obsolete code. Organize the configure checks a bit.
2007-10-04 William Jon McCann <mccann@jhu.edu> * common/Makefile.am: * common/gdm-common.c: * common/gdm-common.h: * common/ve-signal.c: * common/ve-signal.h: * config/Makefile.am: * configure.ac: * daemon/Makefile.am: * daemon/auth.c: * daemon/filecheck.c: * daemon/filecheck.h: * daemon/gdm-factory-slave.c: (get_script_environment): * daemon/gdm-greeter-session.c: (get_greeter_environment): * daemon/gdm-product-slave.c: (get_script_environment): * daemon/gdm-server.c: (rotate_logs), (server_child_setup), (gdm_server_start): * daemon/gdm-simple-slave.c: (get_script_environment): * daemon/gdm-xdmcp-display-factory.c: (fd_set_close_on_exec), (open_port), (gdm_xdmcp_handle_request), (gdm_xdmcp_handle_manage): * libgreeter/Makefile.am: * libgreeter/gdmlanguages.c: * libgreeter/gdmlanguages.h: * libgreeter/gdmsession.c: * libgreeter/gdmsession.h: * libgreeter/gdmwm.c: * libgreeter/gdmwm.h: * utils/Makefile.am: * utils/gdm-ssh-session: * utils/gdmmktemp.c: * utils/gdmopen.c: * utils/gdmprefetch.c: * utils/gdmsetup-pam: * utils/gdmsetup-security.in: * utils/gdmtranslate.c: Remove lots of obsolete code. Organize the configure checks a bit. svn path=/branches/mccann-gobject/; revision=5339
Diffstat (limited to 'utils')
-rw-r--r--utils/Makefile.am54
-rw-r--r--utils/gdm-ssh-session8
-rw-r--r--utils/gdmmktemp.c36
-rw-r--r--utils/gdmopen.c254
-rw-r--r--utils/gdmprefetch.c144
-rw-r--r--utils/gdmsetup-pam6
-rw-r--r--utils/gdmsetup-security.in5
-rw-r--r--utils/gdmtranslate.c51
8 files changed, 2 insertions, 556 deletions
diff --git a/utils/Makefile.am b/utils/Makefile.am
index 4fd77894..19dc4201 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -1,16 +1,11 @@
NULL =
-DEFS = @DEFS@ -DGDM_CONFIG_FILE=\"$(gdmconfdir)/gdm.conf\" \
- -DGDM_FACTORY_CONFIG_FILE=\"$(gdmconfdir)/factory-gdm.conf\" \
- -DGDM_GLADE_DIR=\"@datadir@/gdm\"
-
INCLUDES = \
-I. \
-I.. \
- -I$(top_srcdir)/daemon \
- -I$(top_srcdir)/vicious-extensions \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- $(UTILS_CFLAGS)
+ $(UTILS_CFLAGS) \
+ $(NULL)
edit = sed \
-e 's|@sbindir[@]|$(sbindir)|g' \
@@ -24,9 +19,6 @@ gdm-restart: gdm-restart.in Makefile
$(edit) $< >$@
gdm-safe-restart: gdm-safe-restart.in Makefile
$(edit) $< >$@
-gdmsetup: gdmsetup-security.in
- $(edit) <$(srcdir)/gdmsetup-security.in >gdmsetup
-
sbin_SCRIPTS = \
gdm-stop \
@@ -35,44 +27,15 @@ sbin_SCRIPTS = \
$(NULL)
EXTRA_DIST = \
- gdm-ssh-session \
gdm-stop.in \
gdm-restart.in \
gdm-safe-restart.in \
- gdmsetup-pam \
- gdmsetup-security.in \
$(NULL)
-libexec_SCRIPTS = \
- @GDMSSHSESSION@
-
-libexec_PROGRAMS = \
- @GDMOPEN@ \
- @GDMPREFETCH@ \
- gdmtranslate
-
if DMX_SUPPORT
bin_PROGRAMS = gdm-dmx-reconnect-proxy
endif
-EXTRA_SCRIPTS = gdm-ssh-session
-EXTRA_PROGRAMS = gdmopen gdmprefetch
-
-gdmtranslate_SOURCES = \
- gdmtranslate.c
-
-gdmopen_SOURCES = \
- gdmopen.c
-
-gdmprefetch_SOURCES = \
- gdmprefetch.c
-
-gdmopen_LDADD = \
- $(INTLLIBS)
-
-gdmtranslate_LDADD = \
- $(INTLLIBS)
-
if DMX_SUPPORT
gdm_dmx_reconnect_proxy_SOURCES = \
gdm-dmx-reconnect-proxy.c
@@ -85,23 +48,10 @@ gdm_dmx_reconnect_proxy_LDADD = \
$(DMX_LIBS)
endif
-if CONSOLE_HELPER
-cappsdir = $(PAM_PREFIX)/security/console.apps
-capps_DATA = gdmsetup
-
-install-data-local:
- $(mkinstalldirs) $(DESTDIR)$(PAM_PREFIX)/pam.d
- $(INSTALL_DATA) $(srcdir)/gdmsetup-pam $(DESTDIR)$(PAM_PREFIX)/pam.d/gdmsetup
-else
-install-data-local:
-endif
-
CLEANFILES = \
- gdmsetup-security \
$(NULL)
DISTCLEANFILES = \
- gdmsetup \
gdm-stop \
gdm-restart \
gdm-safe-restart \
diff --git a/utils/gdm-ssh-session b/utils/gdm-ssh-session
deleted file mode 100644
index b70af907..00000000
--- a/utils/gdm-ssh-session
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-
-ZENITY=`which zenity`
-TARGETHOST=`$ZENITY --title "Host to connect to" --entry --text "Enter the name of the host you want to log in to"`
-# @@@ should probably get a user name too;
-# for now can bet set using the $USERNAME@ convention
-# @@@ should it do an ssh-add so the user doesn't have to enter its passphrase again?
-ssh -A -X -T -n "$TARGETHOST" /etc/X11/Xsession
diff --git a/utils/gdmmktemp.c b/utils/gdmmktemp.c
deleted file mode 100644
index dba23650..00000000
--- a/utils/gdmmktemp.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * gdmmkstemp.c by the Queen of England
- * A utility to do mkstemp from a script.
- *
- * Copyright (c) 2001 by Queen of England
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#include "config.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-
-int
-main (int argc, char *argv[])
-{
- char template[] = "/tmp/gdm-XXXXXX";
- int i;
-
- i = mkstemp (template);
- if (i < 0)
- return 1;
-
- fchmod (i, 0600);
-
- printf ("%s\n", template);
- close (i);
- return 0;
-}
diff --git a/utils/gdmopen.c b/utils/gdmopen.c
deleted file mode 100644
index b49f51af..00000000
--- a/utils/gdmopen.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * gdmopen.c by the Queen of England, based upon original open.
- * Simplified for the purposes of gdm. All useless (to me)
- * functionality stripped. Also returns what the command returns.
- * Return of 66 means error with open.
- *
- * Original header:
- *
- * open.c open a vt to run a new command (or shell).
- *
- * Copyright (c) 1994 by Jon Tombs <jon@gtex02.us.es>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#include "config.h"
-#include <stdio.h>
-#include <signal.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-#include <dirent.h>
-#include <pwd.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/vt.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#define IGNORE_EINTR(expr) \
- do { \
- errno = 0; \
- expr; \
- } while (errno == EINTR);
-
-#ifndef FALSE
-#define FALSE 0
-#define TRUE !FALSE
-#endif
-
-
-/*
- * Where your VTs are hidden
- */
-#ifdef __linux__
-#define VTNAME "/dev/tty%d"
-#endif
-
-#ifdef ESIX_5_3_2_D
-#define VTBASE "/dev/vt%02d"
-#endif
-
-const char *GDMOPENversion = "gdmopen " VERSION " simplified (was: open: 1.4 (c) Jon Tombs 1994)";
-
-#ifndef VTNAME
-#error vt device name must be defined in open.c
-#endif
-
-static pid_t child_pid = -1;
-struct vt_stat vt;
-static int vtno;
-static int fd = 0;
-static int do_switchback = FALSE;
-
-static void
-sighandler (int sig)
-{
- if (child_pid > 1) {
- if (kill (child_pid, sig) == 0)
- waitpid (child_pid, NULL, 0);
- }
-
- if (do_switchback) {
- /* Switch back... */
- (void) ioctl(fd, VT_ACTIVATE, vt.v_active);
- /* wait to be really sure we have switched */
- (void) ioctl(fd, VT_WAITACTIVE, vt.v_active);
- }
-
- /* Kill myself with this signal */
- signal (sig, SIG_DFL);
- raise (sig);
-}
-
-int
-main (int argc, char *argv[])
-{
- char vtname[256];
- int status;
- int cmd_start = 1;
- char *command = NULL;
-
- if (getuid () != geteuid () ||
- getuid () != 0) {
- fprintf (stderr, "gdmopen: Only root wants to run me\n");
- return 66;
- }
-
- signal (SIGTERM, sighandler);
- signal (SIGINT, sighandler);
- signal (SIGHUP, sighandler);
-
- if (argc <= 1) {
- fprintf (stderr, "gdmopen: must supply a command!\n");
- return 66;
- }
-
- command = argv[1];
-
- if (strcmp (argv[1], "-l") == 0) {
- char *p;
- if (argc <= 2) {
- fprintf (stderr, "gdmopen: must supply a command!\n");
- return 66;
- }
- /* prepend '-' and start the command at
- * argument 2 */
- cmd_start = 2;
- command = argv[2];
- argv[2] = malloc (strlen (command) + 2);
- if (argv[2] == NULL) {
- fprintf (stderr, "gdmopen: cannot allocate memory!\n");
- return 66;
- }
- p = strrchr (command, '/');
- if (p != NULL) {
- /* make it "-basename" */
- strcpy (argv[2]+1, p+1);
- } else {
- strcpy (argv[2]+1, command);
- }
- *(argv[2]) = '-';
- }
-
- fd = open ("/dev/console", O_WRONLY, 0);
- if (fd < 0) {
- perror ("gdmopen: Failed to open /dev/console");
- return 66;
- }
-
- errno = 0;
- if ((ioctl(fd, VT_OPENQRY, &vtno) < 0) || (vtno == -1)) {
- perror ("gdmopen: Cannot find a free VT");
- IGNORE_EINTR (close (fd));
- return 66;
- }
-
- if (ioctl(fd, VT_GETSTATE, &vt) < 0) {
- perror ("gdmopen: can't get VTstate");
- IGNORE_EINTR (close(fd));
- return 66;
- }
-
- snprintf (vtname, sizeof (vtname), VTNAME, vtno);
-
- chown (vtname, 0, -1);
-
- child_pid = fork();
- if (child_pid == 0) {
- char VT_NUMBER[256];
-
- if (getenv ("UNSAFE_TO_TRANSLATE") != NULL &&
- strcmp (getenv ("UNSAFE_TO_TRANSLATE"), "yes") == 0) {
- putenv ("LANG=C");
-
- /* portable way to truly unset with putenv? */
- putenv ("LC_ALL=");
- putenv ("LC_MESSAGES=");
- putenv ("LC_ALL");
- putenv ("LC_MESSAGES");
- }
-
-#ifdef __linux__
- putenv ("TERM=linux");
-#endif
-
- snprintf (VT_NUMBER, sizeof (VT_NUMBER), "VT_NUMBER=%d", vtno);
- putenv (VT_NUMBER);
-
- signal (SIGTERM, SIG_DFL);
- signal (SIGINT, SIG_DFL);
- signal (SIGHUP, SIG_DFL);
-
- /* leave current vt */
- if (
-#ifdef ESIX_5_3_2_D
- setpgrp() < 0
-#else
- setsid() < 0
-#endif
- ) {
- fprintf(stderr, "open: Unable to set new session (%s)\n",
- strerror(errno));
- }
- IGNORE_EINTR (close (0));
- IGNORE_EINTR (close (1));
- IGNORE_EINTR (close (2));
- IGNORE_EINTR (close (fd));
-
- /* and grab new one */
- fd = open (vtname, O_RDWR);
- if (fd < 0) { /* Shouldn't happen */
- _exit (66); /* silently die */
- }
- dup(fd);
- dup(fd);
-
- /*
- * Can't tell anyone if any of these fail, so throw away
- * the return values
- */
- (void) ioctl(fd, VT_ACTIVATE, vtno);
- /* wait to be really sure we have switched */
- (void) ioctl(fd, VT_WAITACTIVE, vtno);
-
-#ifdef __linux__
- /* Turn on fonts */
- IGNORE_EINTR (write (0, "\033(K", 3));
-#endif /* __linux__ */
-
- execvp (command, &argv[cmd_start]);
-
- _exit (66); /* failed */
- }
-
- if (child_pid < 0) {
- perror ("gdmopen: fork() error");
- return 66;
- }
-
- do_switchback = TRUE;
-
- IGNORE_EINTR (waitpid (child_pid, &status, 0));
- child_pid = -1;
-
- do_switchback = FALSE;
-
- /* Switch back... */
- (void) ioctl(fd, VT_ACTIVATE, vt.v_active);
- /* wait to be really sure we have switched */
- (void) ioctl(fd, VT_WAITACTIVE, vt.v_active);
-
- IGNORE_EINTR (close (fd));
-
- if (WIFEXITED (status))
- return WEXITSTATUS (status);
- else
- return 66;
-}
diff --git a/utils/gdmprefetch.c b/utils/gdmprefetch.c
deleted file mode 100644
index 3e385b7f..00000000
--- a/utils/gdmprefetch.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 2005 Sun Microsystems, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-/*
- * program to either force pages into memory or force them
- * out (-o option)
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <errno.h>
-#include <strings.h>
-
-int out = 0;
-
-static int
-doout(char *s)
-{
- int fd;
- void *map;
- struct stat buf;
-
- if (((fd = open (s, O_RDONLY)) < 0) ||
- (fstat (fd, &buf) < 0) ||
- ((map = mmap (NULL, buf.st_size, PROT_READ, MAP_PRIVATE, fd, 0)) ==
- MAP_FAILED)) {
- (void)close(fd);
- return (-1);
- }
-
- (void)close (fd);
- (void)msync (map, buf.st_size, MS_INVALIDATE);
- (void)munmap (map, buf.st_size);
- return (0);
-}
-
-#define SIZE 1024*128
-
-static int
-doin (char *s)
-{
- int fd;
- char buffer[SIZE];
-
- if ((fd = open(s, O_RDONLY)) < 0) {
- fprintf (stderr, "fopen: %s %s\n", strerror (errno), s);
- return (-1);
- }
-
- while (read (fd, buffer, SIZE) != 0)
- ;
-
- (void)close (fd);
-
- return (0);
-}
-
-int
-main (int argc, char *argv[])
-{
- FILE *fp = 0;
- int c, errflg = 0;
- extern int optind, optopt;
- extern char *optarg;
-
- while ((c = getopt (argc, argv, "o:")) != -1) {
- switch (c) {
-
- case 'o':
- out = 1;
- break;
- default:
- errflg++;
- break;
-
- }
- }
-
- if (errflg) {
- fprintf (stderr, "usage: %s [-o] filename [filename]\n",
- argv[0]);
- exit (1);
- }
-
-
- for (; optind < argc; optind++) {
- if ((argv[optind][0] == '@') && ((fp = fopen (argv[optind], "r")) == 0)) {
- char path[1024];
-
- if ((fp = fopen (&(argv[optind][1]), "r")) == 0) {
- fprintf (stderr, "fopen: %s %s\n", strerror (errno), &argv[optind][1]);
- continue;
- }
- while (fgets (path, sizeof (path), fp) != 0) {
- path[strlen(path) -1] = '\0';
-
- if (path[0] == '#') {
- continue;
- }
-
- if (!out) {
- doin (path);
- } else {
- doout (path);
- }
- }
- fclose (fp);
- fp = 0;
-
- } else {
- if (fp != 0) {
- fclose (fp);
- fp = 0;
- }
-
- if (!out) {
- doin (argv[optind]);
- } else {
- doout (argv[optind]);
- }
- }
- }
- exit (0);
-}
-
diff --git a/utils/gdmsetup-pam b/utils/gdmsetup-pam
deleted file mode 100644
index ecb84946..00000000
--- a/utils/gdmsetup-pam
+++ /dev/null
@@ -1,6 +0,0 @@
-#%PAM-1.0
-auth sufficient pam_rootok.so
-auth required pam_stack.so service=system-auth
-session required pam_permit.so
-session optional pam_xauth.so
-account required pam_permit.so
diff --git a/utils/gdmsetup-security.in b/utils/gdmsetup-security.in
deleted file mode 100644
index 4db426ac..00000000
--- a/utils/gdmsetup-security.in
+++ /dev/null
@@ -1,5 +0,0 @@
-USER=root
-PROGRAM=@sbindir@/gdmsetup
-SESSION=true
-FALLBACK=false
-
diff --git a/utils/gdmtranslate.c b/utils/gdmtranslate.c
deleted file mode 100644
index 03814919..00000000
--- a/utils/gdmtranslate.c
+++ /dev/null
@@ -1,51 +0,0 @@
-#include "config.h"
-#include <stdio.h>
-#include <locale.h>
-#include <string.h>
-#include <stdlib.h>
-
-#define gboolean char
-#define FALSE 0
-#define TRUE 1
-
-#ifdef ENABLE_NLS
-#include <libintl.h>
-#define _(String) gettext(String)
-#else /* !ENABLE_NLS */
-#define _(String) (String)
-#endif
-
-int
-main (int argc, char *argv[])
-{
- char *string;
- gboolean is_utf8 = FALSE;
-
- if (argc == 3 &&
- strcmp (argv[1], "--utf8") == 0) {
- string = argv[2];
- is_utf8 = TRUE;
- } else if (argc == 2) {
- string = argv[1];
- is_utf8 = FALSE;
- } else {
- fprintf (stderr, "usage: gdmtranslate [--utf8] <string to translate>\n");
- return 0;
- }
-
- if (getenv ("UNSAFE_TO_TRANSLATE") != NULL &&
- strcmp (getenv ("UNSAFE_TO_TRANSLATE"), "yes") == 0) {
- printf ("%s\n", string);
- return 0;
- }
-
- setlocale (LC_ALL, "");
- bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
- if (is_utf8)
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
- printf ("%s\n", _(string));
-
- return 0;
-}