From 7f11163236c02ef7ad0f3b48c705ad893c2b9f9b Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 17 Apr 2020 17:47:07 +0200 Subject: [PATCH] open-uri: Reject more mismatched open requests Also reject non-writable requests that come with writable file descriptors. See https://github.com/flatpak/libportal/pull/26 --- src/open-uri.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/open-uri.c b/src/open-uri.c index a8326ed50..21d39546a 100644 --- a/src/open-uri.c +++ b/src/open-uri.c @@ -596,7 +596,8 @@ handle_open_in_thread_func (GTask *task, path = xdp_app_info_get_path_for_fd (request->app_info, fd, 0, NULL, &fd_is_writable); if (path == NULL || - (writable && !fd_is_writable)) + (writable && !fd_is_writable) || + (!xdp_app_info_is_host (request->app_info) && !writable && fd_is_writable)) { /* Reject the request */ if (request->exported)