cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Jan Pokorný <jpokorny@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 2/3] rgmanager: ra2rng.xsl: apache-*: datatype/restrict the params
Date: Mon,  9 Dec 2013 22:02:59 +0100	[thread overview]
Message-ID: <1386622980-18460-3-git-send-email-jpokorny@redhat.com> (raw)
In-Reply-To: <1386622980-18460-1-git-send-email-jpokorny@redhat.com>

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



  parent reply	other threads:[~2013-12-09 21:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-09 21:02 [Cluster-devel] [resource-agents][PATCH 0/3] rgmanager: ra2rng.xsl: MYSQL+APACHE+LVM params datatyping Jan Pokorný
2013-12-09 21:02 ` [Cluster-devel] [PATCH 1/3] rgmanager: ra2rng.xsl: mysql-*: datatype/restrict the params Jan Pokorný
2013-12-09 21:02 ` Jan Pokorný [this message]
2013-12-09 21:03 ` [Cluster-devel] [PATCH 3/3] rgmanager: ra2rng.xsl: lvm-*: " Jan Pokorný

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=1386622980-18460-3-git-send-email-jpokorny@redhat.com \
    --to=jpokorny@redhat.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;
as well as URLs for NNTP newsgroup(s).