use O_EXCL when creating files during extraction
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
98c54240e6
commit
6988b29bdc
|
@ -1187,7 +1187,7 @@ impl<'a> ExtractorState<'a> {
|
|||
std::fs::File::from_raw_fd(nix::fcntl::openat(
|
||||
parent,
|
||||
entry.file_name(),
|
||||
OFlag::O_CREAT | OFlag::O_WRONLY | OFlag::O_CLOEXEC,
|
||||
OFlag::O_CREAT | OFlag::O_EXCL | OFlag::O_WRONLY | OFlag::O_CLOEXEC,
|
||||
Mode::from_bits(0o600).unwrap(),
|
||||
)?)
|
||||
});
|
||||
|
|
|
@ -319,7 +319,7 @@ impl Extractor {
|
|||
std::fs::File::from_raw_fd(nix::fcntl::openat(
|
||||
parent,
|
||||
file_name,
|
||||
OFlag::O_CREAT | OFlag::O_WRONLY | OFlag::O_CLOEXEC,
|
||||
OFlag::O_CREAT | OFlag::O_EXCL | OFlag::O_WRONLY | OFlag::O_CLOEXEC,
|
||||
Mode::from_bits(0o600).unwrap(),
|
||||
)?)
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue