mirror of
https://git.proxmox.com/git/proxmox
synced 2025-10-04 19:36:03 +00:00
atomic_open_or_create_file: catch unsupported flag OFlag::O_DIRECTORY
This commit is contained in:
parent
c7e1a1f3c8
commit
b46a0720ae
@ -205,6 +205,10 @@ pub fn atomic_open_or_create_file<P: AsRef<Path>>(
|
||||
bail!("open {:?} failed - unsupported OFlag O_TMPFILE", path);
|
||||
}
|
||||
|
||||
if oflag.contains(OFlag::O_DIRECTORY) {
|
||||
bail!("open {:?} failed - unsupported OFlag O_DIRECTORY", path);
|
||||
}
|
||||
|
||||
oflag.remove(OFlag::O_CREAT); // we want to handle CREAT ourselfes
|
||||
|
||||
// Note: 'mode' is ignored, because oflag does not contain O_CREAT or O_TMPFILE
|
||||
|
Loading…
Reference in New Issue
Block a user