From 9f51c826669d7302192a3471f5e50d0ccd6fce03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 29 Jan 2015 00:44:38 +0100 Subject: [PATCH] filecopy: fallback to "open(..., 000)" method when /proc inaccessible /proc is needed to link files opened with O_TMPFILE to the filesystem. If not available, fallback to using permissions to block file access, instead of failing the whole file copy. --- qubes-rpc/qfile-unpacker.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qubes-rpc/qfile-unpacker.c b/qubes-rpc/qfile-unpacker.c index 3784dc2..4ad2648 100644 --- a/qubes-rpc/qfile-unpacker.c +++ b/qubes-rpc/qfile-unpacker.c @@ -71,9 +71,10 @@ int main(int argc __attribute((__unused__)), char ** argv __attribute__((__unuse } procfs_fd = open(procdir_path, O_DIRECTORY | O_RDONLY); if (procfs_fd < 0) - gui_fatal("Failed to open /proc"); + perror("Failed to open /proc"); + else + set_procfs_fd(procfs_fd); free(procdir_path); - set_procfs_fd(procfs_fd); if (chroot(".")) gui_fatal("Error chroot to %s", incoming_dir);