Skip to contentSkip to conversation

docs: Clarify formatting for 'fmode' and 'dmode'

PATCH New Brian Turek 1 participant 2 messages Oct 6, 2020

lore
Share & tools
lore
#0 lore raw

cover docs: Clarify formatting for 'fmode' and 'dmode'

The current documentation for the 'fmode' and 'dmode' options for fsdev/virtfs is ambiguous for the expected format of the values. The code itself parses the value using a call to strtoull with base=0 which causes values like "644" and "755" to be parsed as base-10 rather than base-8. This can cause unexpected behavior.

This patch changes the docmentation to be explicit on the expected format and mentions the fact that the setuid, setgid, and sticky bit are dropped.

Brian Turek (1):
docs: Clarify formatting for 'fmode' and 'dmode'

 qemu-options.hx | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 docs: Clarify formatting for 'fmode' and 'dmode'

Explictly state that the 'fmode' and 'dmode' values for a fsdev/virtfs must be formatted with a preceeding 0 to be interpreted as base-8. Currently the code will parse a value like "644" as base-10 which leads to unexpected behavior.

---
 qemu-options.hx | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
qemu-options.hx +6 -2
index 1da52a269c..b92f32005a 100644
@@ -1492,12 +1492,16 @@ SRST
     ``fmode=fmode``
         Specifies the default mode for newly created files on the host.
         Works only with security models "mapped-xattr" and
-        "mapped-file".
+        "mapped-file". Must be formatted with a preceeding 0 to be
+        interpreted as a octal value (e.g. 0644). The setuid, setgid,
+        and sticky bit are all ignored.
 
     ``dmode=dmode``
         Specifies the default mode for newly created directories on the
         host. Works only with security models "mapped-xattr" and
-        "mapped-file".
+        "mapped-file". Must be formatted with a preceeding 0 to be
+        interpreted as a octal value (e.g. 0755). The setuid, setgid,
+        and sticky bit are all ignored.
 
     ``throttling.bps-total=b,throttling.bps-read=r,throttling.bps-write=w``
         Specify bandwidth throttling limits in bytes per second, either
Signature · 1 line
2.25.1