all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox 1/2] atomic_open_or_create_file: catch unsupported flag OFlag::O_DIRECTORY
@ 2021-09-20  6:36 Dietmar Maurer
  2021-09-20  6:36 ` [pbs-devel] [PATCH proxmox 2/2] atomic_open_or_create_file: add support for OFlag::O_EXCL Dietmar Maurer
  2021-09-22  5:48 ` [pbs-devel] applied: [PATCH proxmox 1/2] atomic_open_or_create_file: catch unsupported flag OFlag::O_DIRECTORY Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Dietmar Maurer @ 2021-09-20  6:36 UTC (permalink / raw)
  To: pbs-devel

---
 proxmox/src/tools/fs.rs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/proxmox/src/tools/fs.rs b/proxmox/src/tools/fs.rs
index 6ae4c8a..3283d04 100644
--- a/proxmox/src/tools/fs.rs
+++ b/proxmox/src/tools/fs.rs
@@ -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
-- 
2.30.2





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-22  5:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-20  6:36 [pbs-devel] [PATCH proxmox 1/2] atomic_open_or_create_file: catch unsupported flag OFlag::O_DIRECTORY Dietmar Maurer
2021-09-20  6:36 ` [pbs-devel] [PATCH proxmox 2/2] atomic_open_or_create_file: add support for OFlag::O_EXCL Dietmar Maurer
2021-09-22  5:48 ` [pbs-devel] applied: [PATCH proxmox 1/2] atomic_open_or_create_file: catch unsupported flag OFlag::O_DIRECTORY Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal