Merge branch 'backport-1274-trash-symlinks-glib-2-62' into 'glib-2-62'

Backport !1274 “trash portal: Don't follow symlinks” to glib-2-62

See merge request GNOME/glib!1276
This commit is contained in:
Philip Withnall
2019-12-11 13:22:17 +00:00

View File

@@ -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;