Check if QubesIncoming filesystem supports O_TMPFILE

The filesystem hosting ~/QubesIncoming/srcVM/ needs to support O_TMPFILE
too, in addition to the kernel. If it doesn't, take the use_tmpfile = 0
fallback.
pull/1/head
Rusty Bird 9 years ago
parent 5b250eb279
commit 74a1b4cc50
No known key found for this signature in database
GPG Key ID: 469D78F47AAF2ADF

@ -112,11 +112,11 @@ void process_one_file_reg(struct file_header *untrusted_hdr,
if (use_tmpfile) { if (use_tmpfile) {
fdout = open(".", O_WRONLY | O_TMPFILE, 0700); fdout = open(".", O_WRONLY | O_TMPFILE, 0700);
if (fdout < 0) { if (fdout < 0) {
if (errno==ENOENT) if (errno==ENOENT || /* most likely, kernel too old for O_TMPFILE */
/* if it fails, do not attempt further use - most likely kernel too old */ errno==EOPNOTSUPP) /* filesystem has no support for O_TMPFILE */
use_tmpfile = 0; use_tmpfile = 0;
else else
do_exit(errno, untrusted_name); do_exit(errno, untrusted_name);
} }
} }
if (fdout < 0) if (fdout < 0)

Loading…
Cancel
Save