mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 22:16:16 +01:00
Merge branch 'fix-trashing-sandboxed-directories' into 'main'
Fix trashing sandboxed directories Closes #2629 See merge request GNOME/glib!2583
This commit is contained in:
commit
259c86909f
@ -89,8 +89,12 @@ g_trash_portal_trash_file (GFile *file,
|
|||||||
|
|
||||||
fd = g_open (path, O_RDWR | O_CLOEXEC | O_NOFOLLOW);
|
fd = g_open (path, O_RDWR | O_CLOEXEC | O_NOFOLLOW);
|
||||||
if (fd == -1 && errno == EISDIR)
|
if (fd == -1 && errno == EISDIR)
|
||||||
/* If it is a directory, fall back to O_PATH */
|
/* If it is a directory, fall back to O_PATH.
|
||||||
fd = g_open (path, O_PATH | O_CLOEXEC | O_RDONLY | O_NOFOLLOW);
|
* Remove O_NOFOLLOW since
|
||||||
|
* a) we know it is a directory, not a symlink, and
|
||||||
|
* b) the portal reject this combination
|
||||||
|
*/
|
||||||
|
fd = g_open (path, O_PATH | O_CLOEXEC | O_RDONLY);
|
||||||
|
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user