diff options
author | George Lebl <jirka@5z.com> | 2003-09-26 17:45:37 +0000 |
---|---|---|
committer | George Lebl <jirka@src.gnome.org> | 2003-09-26 17:45:37 +0000 |
commit | 7e0298ffec4a49050ea8556503a159db4ab12cb9 (patch) | |
tree | c4dced6ae815d8e0e730a1680142644bb10fca07 | |
parent | 8937e930fa42b45e681964f911ce68dfc95cc07b (diff) | |
download | gdm-7e0298ffec4a49050ea8556503a159db4ab12cb9.tar.gz |
to be even analer about filenames of user pics, first run through realpath
Fri Sep 26 10:44:18 2003 George Lebl <jirka@5z.com>
* daemon/slave.c: to be even analer about filenames of user pics,
first run through realpath first.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | daemon/slave.c | 12 |
2 files changed, 17 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Fri Sep 26 10:44:18 2003 George Lebl <jirka@5z.com> + + * daemon/slave.c: to be even analer about filenames of user pics, + first run through realpath first. + Thu Sep 25 15:42:20 2003 George Lebl <jirka@5z.com> * Release 2.4.4.3 diff --git a/daemon/slave.c b/daemon/slave.c index 853b3d18..0cbcb0cc 100644 --- a/daemon/slave.c +++ b/daemon/slave.c @@ -1916,11 +1916,23 @@ run_pictures (void) /* Note that these days we just set ~/.face */ if G_UNLIKELY (picfile != NULL && (picfile[0] != '/' || + /* this catches readability by user */ access (picfile, R_OK) != 0)) { g_free (picfile); picfile = NULL; } + if (picfile != NULL) { + char buf[PATH_MAX]; + if (realpath (picfile, buf) == NULL) { + g_free (picfile); + picfile = NULL; + } else { + g_free (picfile); + picfile = g_strdup (buf); + } + } + if G_UNLIKELY (picfile != NULL) { char *dir; char *base; |