* [Cluster-devel] [resource-agents][PATCH 0/3] rgmanager: ra2rng.xsl: MYSQL+APACHE+LVM params datatyping @ 2013-12-09 21:02 Jan Pokorný 2013-12-09 21:02 ` [Cluster-devel] [PATCH 1/3] rgmanager: ra2rng.xsl: mysql-*: datatype/restrict the params Jan Pokorný ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: Jan Pokorný @ 2013-12-09 21:02 UTC (permalink / raw) To: cluster-devel.redhat.com In line with previous changeset [1] (and the infrastructure built in preceding [2]), extend parameters validation for these RAs: * mysql * apache * lvm by datatyping and otherwise restricting them. It becomes apparent that more and more params with the same properties are shared across various RAs, hence more and more of them are likely to be moved to WILDCARD section with forthcoming progress. Note to [1]+[2]: due to two intermediate steps to get resulting cluster.rng (furthermore composed from various components' input), some mistakes/bad decisions were not discovered until more "integration" testing was performed --> this explains why there were so many reiterations of these previous changes, and the last version per each change can now be considered final [1] http://www.redhat.com/archives/cluster-devel/2013-December/msg00052.html [2] http://www.redhat.com/archives/cluster-devel/2013-December/msg00037.html Jan Pokorn? (3): rgmanager: ra2rng.xsl: mysql-*: datatype/restrict the params rgmanager: ra2rng.xsl: apache-*: datatype/restrict the params rgmanager: ra2rng.xsl: lvm-*: datatype/restrict the params rgmanager/src/resources/ra2rng.xsl | 122 +++++++++++++++++++++++++++++++++---- 1 file changed, 109 insertions(+), 13 deletions(-) -- 1.8.1.4 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Cluster-devel] [PATCH 1/3] rgmanager: ra2rng.xsl: mysql-*: datatype/restrict the params 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 ` Jan Pokorný 2013-12-09 21:02 ` [Cluster-devel] [PATCH 2/3] rgmanager: ra2rng.xsl: apache-*: " Jan Pokorný 2013-12-09 21:03 ` [Cluster-devel] [PATCH 3/3] rgmanager: ra2rng.xsl: lvm-*: " Jan Pokorný 2 siblings, 0 replies; 4+ messages in thread From: Jan Pokorný @ 2013-12-09 21:02 UTC (permalink / raw) To: cluster-devel.redhat.com Signed-off-by: Jan Pokorn? <jpokorny@redhat.com> --- rgmanager/src/resources/ra2rng.xsl | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl index 9ee83d0..4cce0da 100644 --- a/rgmanager/src/resources/ra2rng.xsl +++ b/rgmanager/src/resources/ra2rng.xsl @@ -204,6 +204,46 @@ </data> </int:parameter> </int:agent> + <!-- MYSQL --> + <int:agent name="mysql"> + <!-- int:parameter name="name"/ --> + <int:parameter name="config_file"> + <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="listen_address"> + <data type="string"> + <!-- can be either IP (v4 only?) address or a hostname; + as per netware/mysqld_safe.c limited by PATH_MAX --> + <param name="pattern">[\p{IsBasicLatin}\p{IsLatin-1Supplement}-[\s]]+</param> + <param name="maxLength">4095</param> + </data> + </int:parameter> + <int:parameter name="mysqld_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> + <int:parameter name="startup_wait"> + <data type="int"> + <param name="minInclusive">0</param> + </data> + </int:parameter> + <int:parameter name="shutdown_wait"> + <data type="int"> + <param name="minInclusive">0</param> + </data> + </int:parameter> + <!-- int:parameter name="service_name"/ --> + </int:agent> </int:agent-parameter-specialization> <xsl:variable name="SP" select="' '"/> -- 1.8.1.4 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Cluster-devel] [PATCH 2/3] rgmanager: ra2rng.xsl: apache-*: datatype/restrict the params 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ý 2013-12-09 21:03 ` [Cluster-devel] [PATCH 3/3] rgmanager: ra2rng.xsl: lvm-*: " Jan Pokorný 2 siblings, 0 replies; 4+ messages in thread From: Jan Pokorný @ 2013-12-09 21:02 UTC (permalink / raw) To: cluster-devel.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 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Cluster-devel] [PATCH 3/3] rgmanager: ra2rng.xsl: lvm-*: datatype/restrict the params 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 ` [Cluster-devel] [PATCH 2/3] rgmanager: ra2rng.xsl: apache-*: " Jan Pokorný @ 2013-12-09 21:03 ` Jan Pokorný 2 siblings, 0 replies; 4+ messages in thread From: Jan Pokorný @ 2013-12-09 21:03 UTC (permalink / raw) To: cluster-devel.redhat.com Signed-off-by: Jan Pokorn? <jpokorny@redhat.com> --- rgmanager/src/resources/ra2rng.xsl | 48 +++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl index 748d3a1..98de4a5 100644 --- a/rgmanager/src/resources/ra2rng.xsl +++ b/rgmanager/src/resources/ra2rng.xsl @@ -26,6 +26,19 @@ <value type="string">yes</value> </choice> </int:parameter> + <int:parameter name="self_fence"> + <choice> + <!-- note: a bit stricter than what the code enforces --> + <value type="token">0</value> + <value type="token">1</value> + <value type="token">no</value> + <value type="token">yes</value> + <value type="token">false</value> + <value type="token">true</value> + <value type="token">off</value> + <value type="token">on</value> + </choice> + </int:parameter> <int:parameter name="shutdown_wait"> <data type="int"> <param name="minInclusive">0</param> @@ -112,19 +125,7 @@ <value type="string">1</value> </choice> </int:parameter> - <int:parameter name="self_fence"> - <choice> - <!-- note: a bit stricter than what the code enforces --> - <value type="token">0</value> - <value type="token">1</value> - <value type="token">no</value> - <value type="token">yes</value> - <value type="token">false</value> - <value type="token">true</value> - <value type="token">off</value> - <value type="token">on</value> - </choice> - </int:parameter> + <!-- self_fence: see WILDCARD --> <!-- nfslock: see WILDCARD --> <int:parameter name="nfsrestart"> <choice> @@ -229,6 +230,27 @@ </data> </int:parameter> </int:agent> + <!-- LVM --> + <int:agent name="lvm"> + <!-- int:parameter name="name"/ --> + <int:parameter name="vg_name"> + <data type="string"> + <!-- would be "token" unless single(?) use that breaks it --> + <!-- https://bugzilla.redhat.com/show_bug.cgi?id=747278#c6 --> + <param name="pattern">[\p{IsBasicLatin}\p{IsLatin-1Supplement}]+</param> + <param name="maxLength">63</param> + </data> + </int:parameter> + <int:parameter name="lv_name"> + <data type="string"> + <!-- https://bugzilla.redhat.com/show_bug.cgi?id=747278#c6 --> + <param name="pattern">[\p{IsBasicLatin}\p{IsLatin-1Supplement}]+</param> + <param name="maxLength">63</param> + </data> + </int:parameter> + <!-- self_fence: see WILDCARD --> + <!-- nfslock: see WILDCARD --> + </int:agent> <!-- SCRIPT --> <int:agent name="script"> <int:parameter name="file"> -- 1.8.1.4 ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-12-09 21:03 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 ` [Cluster-devel] [PATCH 2/3] rgmanager: ra2rng.xsl: apache-*: " Jan Pokorný 2013-12-09 21:03 ` [Cluster-devel] [PATCH 3/3] rgmanager: ra2rng.xsl: lvm-*: " Jan Pokorný
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).