Ver código fonte

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.
Marek Marczykowski-Górecki 9 anos atrás
pai
commit
9f51c82666
1 arquivos alterados com 3 adições e 2 exclusões
  1. 3 2
      qubes-rpc/qfile-unpacker.c

+ 3 - 2
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);