summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2009-01-30 21:19:36 +0000
committerRyan Lortie <ryanl@src.gnome.org>2009-01-30 21:19:36 +0000
commitac5258d2386fae836684a52e7e36642a1a1cb93e (patch)
tree643243096bcfa636f75be5675598aaa77bc75772 /daemon
parent52414c80acac74cbc486fb3fe4e3f5c0f7b8f85e (diff)
downloadgvfs-ac5258d2386fae836684a52e7e36642a1a1cb93e.tar.gz
Bug 512144 – symlinks to folders are deleted recursively
2009-01-28 Ryan Lortie <desrt@desrt.ca> Bug 512144 – symlinks to folders are deleted recursively * desrt: place a paper bag over my face * daemon/trashlib/trashexpunge.c: try a lot harder to not follow symlinks. svn path=/trunk/; revision=2187
Diffstat (limited to 'daemon')
-rw-r--r--daemon/trashlib/trashexpunge.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/daemon/trashlib/trashexpunge.c b/daemon/trashlib/trashexpunge.c
index 00bd2d4e..782be54e 100644
--- a/daemon/trashlib/trashexpunge.c
+++ b/daemon/trashlib/trashexpunge.c
@@ -25,7 +25,8 @@ trash_expunge_delete_everything_under (GFile *directory)
NULL, NULL);
enumerator = g_file_enumerate_children (directory,
- G_FILE_ATTRIBUTE_STANDARD_NAME,
+ G_FILE_ATTRIBUTE_STANDARD_NAME ","
+ G_FILE_ATTRIBUTE_STANDARD_TYPE,
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
NULL, NULL);
@@ -40,7 +41,9 @@ trash_expunge_delete_everything_under (GFile *directory)
basename = g_file_info_get_name (info);
sub = g_file_get_child (directory, basename);
- trash_expunge_delete_everything_under (sub);
+
+ if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY)
+ trash_expunge_delete_everything_under (sub);
/* do the delete here */
g_file_delete (sub, NULL, NULL);