diff options
author | George Lebl <jirka@5z.com> | 2001-05-31 02:16:35 +0000 |
---|---|---|
committer | George Lebl <jirka@src.gnome.org> | 2001-05-31 02:16:35 +0000 |
commit | f11c880dc778229ea6991121bad862fb4089c22f (patch) | |
tree | a95715300dcc020721d4a5d5e214caa0d7f36cdf | |
parent | 2cc71c36b029d8d9be242793e768a9d08d1221dc (diff) | |
download | gdm-f11c880dc778229ea6991121bad862fb4089c22f.tar.gz |
fix permission setting, and open the source before dest. Though a bit
Wed May 30 19:17:46 2001 George Lebl <jirka@5z.com>
* gui/gdmphotosetup.c: fix permission setting, and open the source
before dest. Though a bit pointless since jrb is apprently
rewriting the whole bit :)
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | gui/gdmphotosetup.c | 19 |
2 files changed, 16 insertions, 9 deletions
@@ -1,3 +1,9 @@ +Wed May 30 19:17:46 2001 George Lebl <jirka@5z.com> + + * gui/gdmphotosetup.c: fix permission setting, and open the source + before dest. Though a bit pointless since jrb is apprently + rewriting the whole bit :) + Wed May 30 16:19:39 2001 George Lebl <jirka@5z.com> * daemon/gdm.[ch], daemon/slave.c, gui/gdmconfig.(c|glade): diff --git a/gui/gdmphotosetup.c b/gui/gdmphotosetup.c index 74dc668f..a9465c00 100644 --- a/gui/gdmphotosetup.c +++ b/gui/gdmphotosetup.c @@ -109,36 +109,37 @@ main (int argc, char *argv[]) NULL); int fddest, fdsrc; - fddest = open (photofile, O_WRONLY | O_CREAT); - if (fddest < 0) { + fdsrc = open (pixmap, O_RDONLY); + if (fdsrc < 0) { GtkWidget *d; char *msg = g_strdup_printf (_("File %s cannot be open for " - "writing\nError: %s"), - photofile, + "reading\nError: %s"), + pixmap, g_strerror (errno)); d = gnome_warning_dialog (msg); gnome_dialog_run_and_close (GNOME_DIALOG (d)); g_free (photofile); continue; } - fdsrc = open (pixmap, O_RDONLY); - if (fdsrc < 0) { + fddest = open (photofile, O_WRONLY | O_CREAT); + if (fddest < 0) { GtkWidget *d; char *msg = g_strdup_printf (_("File %s cannot be open for " - "reading\nError: %s"), - pixmap, + "writing\nError: %s"), + photofile, g_strerror (errno)); d = gnome_warning_dialog (msg); gnome_dialog_run_and_close (GNOME_DIALOG (d)); g_free (photofile); - close (fddest); + close (fdsrc); continue; } while ((size = read (fdsrc, buf, sizeof (buf))) > 0) { write (fddest, buf, size); } + fchmod (fddest, 0600); close (fdsrc); close (fddest); gnome_config_set_string ("/gdmphotosetup/last/picture", |