public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dietmar Maurer <dietmar@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox 1/2] atomic_open_or_create_file: catch unsupported flag OFlag::O_DIRECTORY
Date: Mon, 20 Sep 2021 08:36:13 +0200	[thread overview]
Message-ID: <20210920063614.3151663-1-dietmar@proxmox.com> (raw)

---
 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





             reply	other threads:[~2021-09-20  6:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20  6:36 Dietmar Maurer [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210920063614.3151663-1-dietmar@proxmox.com \
    --to=dietmar@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal