summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Lebl <jirka@5z.com>2002-05-27 21:37:05 +0000
committerGeorge Lebl <jirka@src.gnome.org>2002-05-27 21:37:05 +0000
commitc644978b53d2f0ef17c5fcdc3aab4c278e5d45c9 (patch)
tree269cf7daa2f0bedd21a3dd1a10ea2a9c3b14158a
parenteb79ed93b77b72af473bfe9a8190b4d2954139fd (diff)
downloadgdm-c644978b53d2f0ef17c5fcdc3aab4c278e5d45c9.tar.gz
remove some dead code, minor fixes
Mon May 27 13:39:52 2002 George Lebl <jirka@5z.com> * daemon/auth.c, daemon/slave.c: remove some dead code, minor fixes * gui/gdmchooser.c: remove gnome init, remove dead code * gui/gdmlogin.c: remove hang on browser image getting * gui/gdmphotosetup.c: remove the trusted dir crap. Now we always copy to ~/.gnome/photo. this removes the need for needing to know gnome's pixmap path, and gets rid of some uglieness. We still support a bit of the trusted dir stuff in the daemon for compatibility. * gui/gdmsetup.c: don't create dirs only when running under gdm
-rw-r--r--ChangeLog16
-rw-r--r--daemon/auth.c3
-rw-r--r--daemon/slave.c28
-rw-r--r--gui/gdmchooser.c42
-rw-r--r--gui/gdmlogin.c1
-rw-r--r--gui/gdmphotosetup.c40
-rw-r--r--gui/gdmsetup.c2
7 files changed, 39 insertions, 93 deletions
diff --git a/ChangeLog b/ChangeLog
index 64fdccd4..f0ea3338 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+Mon May 27 13:39:52 2002 George Lebl <jirka@5z.com>
+
+ * daemon/auth.c, daemon/slave.c: remove some dead code, minor fixes
+
+ * gui/gdmchooser.c: remove gnome init, remove dead code
+
+ * gui/gdmlogin.c: remove hang on browser image getting
+
+ * gui/gdmphotosetup.c: remove the trusted dir crap. Now we always
+ copy to ~/.gnome/photo. this removes the need for needing to
+ know gnome's pixmap path, and gets rid of some uglieness. We
+ still support a bit of the trusted dir stuff in the daemon for
+ compatibility.
+
+ * gui/gdmsetup.c: don't create dirs only when running under gdm
+
2002-05-27 Kjartan Maraas <kmaraas@gnome.org>
* daemon/verify-pam.c: Fix typo.
diff --git a/daemon/auth.c b/daemon/auth.c
index a2a17c2c..acf4eb7d 100644
--- a/daemon/auth.c
+++ b/daemon/auth.c
@@ -467,7 +467,8 @@ gdm_auth_user_add (GdmDisplay *d, uid_t user, const char *homedir)
while (auths) {
if ( ! XauWriteAuth (af, auths->data)) {
- gdm_error (_("%s: Could not write cookie"));
+ gdm_error (_("%s: Could not write cookie"),
+ "gdm_auth_user_add");
ret = FALSE;
break;
}
diff --git a/daemon/slave.c b/daemon/slave.c
index cd5c6ae3..77e017bd 100644
--- a/daemon/slave.c
+++ b/daemon/slave.c
@@ -1016,37 +1016,15 @@ gdm_slave_wait_for_login (void)
}
/* If path starts with a "trusted" directory, don't sanity check things */
+/* This is really somewhat "outdated" as we now really want things in
+ * the picture dir or in ~/.gnome/photo */
static gboolean
is_in_trusted_pic_dir (const char *path)
{
-#if 0
- GSList *locations = NULL, *li;
-#endif
-
/* our own pixmap dir is trusted */
if (strncmp (path, EXPANDED_PIXMAPDIR, sizeof (EXPANDED_PIXMAPDIR)) == 0)
return TRUE;
- /* FIXME: somehow get gnomes locations and all that */
-#if 0
- /* we have no gnome-program and we don't want one */
- g_free (gnome_program_locate_file (NULL /* program */,
- GNOME_FILE_DOMAIN_PIXMAP,
- "" /* file_name */,
- FALSE /* only_if_exists */,
- &locations));
- for (li = locations; li != NULL; li = li->next) {
- /* gnome's pixmap dirs are trusted */
- if (strncmp (path, li->data, strlen (li->data)) == 0) {
- g_slist_foreach (locations, (GFunc)g_free, NULL);
- g_slist_free (locations);
- return TRUE;
- }
- }
- g_slist_foreach (locations, (GFunc)g_free, NULL);
- g_slist_free (locations);
-#endif
-
return FALSE;
}
@@ -1074,7 +1052,7 @@ run_pictures (void)
g_free (response);
return;
}
-
+
pwent = getpwnam (response);
if (pwent == NULL) {
gdm_slave_greeter_ctl_no_ret (GDM_READPIC, "");
diff --git a/gui/gdmchooser.c b/gui/gdmchooser.c
index d77490eb..2c2f1ece 100644
--- a/gui/gdmchooser.c
+++ b/gui/gdmchooser.c
@@ -1028,12 +1028,10 @@ gdm_event (GSignalInvocationHint *ihint,
int
main (int argc, char *argv[])
{
- char **fixedargv;
- int fixedargc, i;
char **hosts;
poptContext ctx;
+ int nextopt;
const char *gdm_version;
- GnomeProgram *program;
if (g_getenv ("DOING_GDM_DEVELOPMENT") != NULL)
DOING_GDM_DEVELOPMENT = TRUE;
@@ -1042,32 +1040,26 @@ main (int argc, char *argv[])
openlog ("gdmchooser", LOG_PID, LOG_DAEMON);
- fixedargc = argc + 1;
- fixedargv = g_new0 (gchar *, fixedargc);
-
- for (i=0; i < argc; i++)
- fixedargv[i] = argv[i];
-
- fixedargv[fixedargc-1] = "--disable-sound";
-
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
- program = gnome_program_init ("gdmchooser", VERSION,
- /* FIXME: oh fuck this inits way too much
- * shit that we don't want */
- LIBGNOMEUI_MODULE /* module_info */,
- fixedargc, fixedargv,
- GNOME_PARAM_POPT_TABLE, xdm_options,
- GNOME_PARAM_CREATE_DIRECTORIES, FALSE,
- NULL);
-
- g_object_get (G_OBJECT (program),
- GNOME_PARAM_POPT_CONTEXT, &ctx,
- NULL);
- glade_gnome_init();
- g_free (fixedargv);
+ gtk_init (&argc, &argv);
+
+ ctx = poptGetContext ("gdm", argc, (const char **) argv,
+ xdm_options, 0);
+ while ((nextopt = poptGetNextOpt (ctx)) > 0 || nextopt == POPT_ERROR_BADOPT)
+ /* do nothing */ ;
+
+ if (nextopt != -1) {
+ g_print (_("Error on option %s: %s.\nRun '%s --help' to see a full list of available command line options.\n"),
+ poptBadOption (ctx, 0),
+ poptStrerror (nextopt),
+ argv[0]);
+ exit (1);
+ }
+
+ glade_init();
gdm_chooser_parse_config();
diff --git a/gui/gdmlogin.c b/gui/gdmlogin.c
index 82289c4a..caccd188 100644
--- a/gui/gdmlogin.c
+++ b/gui/gdmlogin.c
@@ -3401,7 +3401,6 @@ gdm_login_user_alloc (const gchar *logname, uid_t uid, const gchar *homedir)
img = gdk_pixbuf_new_from_file (&buf[1], NULL);
} else {
img = NULL;
- return user;
}
/* the daemon is now free to go on */
diff --git a/gui/gdmphotosetup.c b/gui/gdmphotosetup.c
index 7d51704d..076b1730 100644
--- a/gui/gdmphotosetup.c
+++ b/gui/gdmphotosetup.c
@@ -30,33 +30,6 @@
#include "gdm.h"
-/* If path starts with a "trusted" directory, don't sanity check things */
-static gboolean
-is_in_trusted_pic_dir (const char *path)
-{
-#if 0
- char *globalpix;
-#endif
-
- /* our own pixmap dir is trusted */
- if (strncmp (path, EXPANDED_PIXMAPDIR, sizeof (EXPANDED_PIXMAPDIR)) == 0)
- return TRUE;
-
- /* FIXME: the daemon is no longer looking here, we need to figure
- * out how to make it do that again */
-#if 0
- /* gnome's pixmap dir is trusted */
- globalpix = gnome_unconditional_pixmap_file ("");
- if (strncmp (path, globalpix, strlen (globalpix)) == 0) {
- g_free (globalpix);
- return TRUE;
- }
- g_free (globalpix);
-#endif
-
- return FALSE;
-}
-
int
main (int argc, char *argv[])
{
@@ -137,19 +110,6 @@ main (int argc, char *argv[])
_("No picture selected."));
gtk_dialog_run (GTK_DIALOG (d));
gtk_widget_destroy (d);
- } else if (is_in_trusted_pic_dir (pixmap)) {
- /* Picture is in trusted dir, no need to copy nor
- * check it */
- char *cfg_file = g_strconcat (g_get_home_dir (),
- "/.gnome/gdm",
- NULL);
- gnome_config_set_string ("/gdm/face/picture",
- pixmap);
- gnome_config_sync ();
- /* ensure proper permissions */
- chmod (cfg_file, 0600);
- g_free (cfg_file);
- break;
} else if (s.st_size > max_size) {
GtkWidget *d;
d = gtk_message_dialog_new (NULL /* parent */,
diff --git a/gui/gdmsetup.c b/gui/gdmsetup.c
index 63932b89..9bfe222c 100644
--- a/gui/gdmsetup.c
+++ b/gui/gdmsetup.c
@@ -1931,7 +1931,7 @@ main (int argc, char *argv[])
LIBGNOMEUI_MODULE /* module_info */,
argc, argv,
/* *GNOME_PARAM_POPT_TABLE, options, */
- GNOME_PARAM_CREATE_DIRECTORIES, FALSE,
+ GNOME_PARAM_CREATE_DIRECTORIES, ! RUNNING_UNDER_GDM,
NULL);
glade_gnome_init();