[glib/glib-2-62: 1/2] trash portal: Don't follow symlinks
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-62: 1/2] trash portal: Don't follow symlinks
- Date: Wed, 11 Dec 2019 13:22:41 +0000 (UTC)
commit 463ccbd58709b1e48c58e0493419862f1fcc9c77
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Dec 10 15:16:33 2019 -0500
trash portal: Don't follow symlinks
We got a complaint here that trashing via the
portal deletes the target of a symlink, not the
symlink itself. It turns out that following the
symlink already happens on the glib side.
https://github.com/flatpak/xdg-desktop-portal/issues/412
gio/gtrashportal.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gio/gtrashportal.c b/gio/gtrashportal.c
index b6aca37a6..9922be21f 100644
--- a/gio/gtrashportal.c
+++ b/gio/gtrashportal.c
@@ -86,10 +86,10 @@ g_trash_portal_trash_file (GFile *file,
path = g_file_get_path (file);
- fd = g_open (path, O_RDWR | O_CLOEXEC);
+ fd = g_open (path, O_RDWR | O_CLOEXEC | O_NOFOLLOW);
if (fd == -1 && errno == EISDIR)
/* If it is a directory, fall back to O_PATH */
- fd = g_open (path, O_PATH | O_CLOEXEC | O_RDONLY);
+ fd = g_open (path, O_PATH | O_CLOEXEC | O_RDONLY | O_NOFOLLOW);
errsv = errno;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]