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

[Cluster-devel] [PATCH 2/3] rgmanager: ra2rng.xsl: apache-*: datatype/restrict the params



Note that this patch effectively limits the liberty that I found was
expected at least in one case [1]:

> <apache config_file="/etc/apache2/apache2.conf" httpd_options=""
>  name="debby" server_root="/var/www/html" shutdown_wait=""/>

i.e., empty shutdown_wait, but it seems reasonable to require either
the parameter is defined and then it has *valid* value, or not defined
at all, that is, to put some boundaries on what is considered
a canonical form (note: mentioned case can be trivially promoted
to such a form using, e.g., XSLT, but it should be a responsibility
of the tooling, not a validator, really).

[1] http://www.redhat.com/archives/linux-cluster/2011-October/msg00035.html

Signed-off-by: Jan Pokorný <jpokorny redhat com>
---
 rgmanager/src/resources/ra2rng.xsl | 44 +++++++++++++++++++++++++++++++++-----
 1 file changed, 39 insertions(+), 5 deletions(-)

diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index 4cce0da..f2cd56f 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -26,6 +26,44 @@
                 <value type="string">yes</value>
             </choice>
         </int:parameter>
+        <int:parameter name="shutdown_wait">
+            <data type="int">
+                <param name="minInclusive">0</param>
+            </data>
+        </int:parameter>
+    </int:agent>
+    <!-- APACHE (should be named, e.g., httpd, not as per foundation) -->
+    <int:agent name="apache">
+        <!-- int:parameter name="name"/ -->
+        <int:parameter name="server_root">
+            <data type="string">
+                <!-- only enforce starting with slash and at the very least
+                     one non-zero length component (otherwise not sane);
+                     maximum path length is as per PATH_MAX - 1 (4095)
+                     from /usr/include/linux/limits.h; spaces allowed -->
+                <param name="pattern">/[\p{IsBasicLatin}\p{IsLatin-1Supplement}]+</param>
+                <param name="maxLength">4095</param>
+            </data>
+        </int:parameter>
+        <int:parameter name="config_file">
+            <data type="string">
+                <!-- only enforce, at the very least, one non-zero length
+                     component (otherwise not sane);
+                     maximum path length is as per PATH_MAX - 1 (4095)
+                     from /usr/include/linux/limits.h; spaces allowed -->
+                <param name="pattern">[\p{IsBasicLatin}\p{IsLatin-1Supplement}]+</param>
+                <param name="maxLength">4095</param>
+            </data>
+        </int:parameter>
+        <int:parameter name="httpd_options">
+            <data type="token">
+                <!-- let's limit it at least by $(getconf ARG_MAX) - 1 bytes -->
+                <param name="pattern">[\p{IsBasicLatin}\p{IsLatin-1Supplement}]+</param>
+                <param name="maxLength">2621440</param>
+            </data>
+        </int:parameter>
+        <!-- shutdown_wait: see WILDCARD -->
+        <!-- int:parameter name="service_name"/ -->
     </int:agent>
     <!-- FS -->
     <int:agent name="fs">
@@ -237,11 +275,7 @@
                 <param name="minInclusive">0</param>
             </data>
         </int:parameter>
-        <int:parameter name="shutdown_wait">
-            <data type="int">
-                <param name="minInclusive">0</param>
-            </data>
-        </int:parameter>
+        <!-- shutdown_wait: see WILDCARD -->
         <!-- int:parameter name="service_name"/ -->
     </int:agent>
 </int:agent-parameter-specialization>
-- 
1.8.1.4


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