[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] schema: Restrict mode to ocal



virStrToLong(..., 8, ...) already requires the mode to be octal.
Change the relax-ng schema to check for octal as well.

Signed-off-by: Philipp Hahn <hahn univention de>
---
 docs/schemas/basictypes.rng  |    6 ++++++
 docs/schemas/storagepool.rng |    2 +-
 docs/schemas/storagevol.rng  |    2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
index ec1d940..e6cf907 100644
--- a/docs/schemas/basictypes.rng
+++ b/docs/schemas/basictypes.rng
@@ -20,6 +20,12 @@
     </data>
   </define>
 
+  <define name='octalMode'>
+    <data type="unsignedInt">
+      <param name='pattern'>[0-7]+</param>
+    </data>
+  </define>
+
   <define name="uint8range">
     <choice>
       <data type="string">
diff --git a/docs/schemas/storagepool.rng b/docs/schemas/storagepool.rng
index 165e276..2b1f08d 100644
--- a/docs/schemas/storagepool.rng
+++ b/docs/schemas/storagepool.rng
@@ -175,7 +175,7 @@
     <optional>
       <element name='permissions'>
         <element name='mode'>
-          <ref name='unsignedInt'/>
+          <ref name='octalMode'/>
         </element>
         <element name='owner'>
           <choice>
diff --git a/docs/schemas/storagevol.rng b/docs/schemas/storagevol.rng
index 10b7847..d4a29c7 100644
--- a/docs/schemas/storagevol.rng
+++ b/docs/schemas/storagevol.rng
@@ -46,7 +46,7 @@
     <optional>
       <element name='permissions'>
         <element name='mode'>
-          <ref name='unsignedInt'/>
+          <ref name='octalMode'/>
         </element>
         <element name='owner'>
           <ref name='unsignedInt'/>
-- 
1.7.10.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]