mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
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
This commit is contained in:
parent
f3de395812
commit
c3ab139841
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user