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.
This commit is contained in:
parent
efb79d5784
commit
9f51c82666
@ -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");
|
||||
free(procdir_path);
|
||||
perror("Failed to open /proc");
|
||||
else
|
||||
set_procfs_fd(procfs_fd);
|
||||
free(procdir_path);
|
||||
|
||||
if (chroot("."))
|
||||
gui_fatal("Error chroot to %s", incoming_dir);
|
||||
|
Loading…
Reference in New Issue
Block a user