On Thu, 04 Aug 2011 13:19:40 +0200
Roman Rakus <rrakus(a)redhat.com> wrote:
I have just concerns about variables, if they can contain any white
space chars. If so, they should be in "quotes". If we are 100% sure
they cannot contain any white space chars I'm ok with this patch.
RR
On 07/29/2011 05:41 PM, Adam Stokes wrote:
> - Provided array variable for defining DNS SRV records or
> a fqdn:port
> - Based on FEDERATED_BROKERS array if DNS SRV record exist
> format dns query answer into<fqdn>:<port>, otherwise
> process as is.
> - Attempt to setup bidirectional communication with all defined
> brokers.
> - Setup a qpid-route TIMEOUT variable so we aren't waiting
> longer than 5 seconds for a broker to respond.
>
> Signed-off-by: Adam Stokes<astokes(a)fedoraproject.org>
> ---
> matahari-broker.init.in | 44
> ++++++++++++++++++++++++++++++++++++++++++++
> matahari-broker.sysconf.in | 8 ++++++++ 2 files changed, 52
> insertions(+), 0 deletions(-)
>
> diff --git a/matahari-broker.init.in b/matahari-broker.init.in
> index 13a535d..ebb35ee 100755
> --- a/matahari-broker.init.in
> +++ b/matahari-broker.init.in
> @@ -42,6 +42,8 @@ pidfile=@localstatedir(a)/run/matahari-broker.pid
> # Turn off automatic systemd redirects
> SYSTEMCTL_SKIP_REDIRECT=1
>
> +# Timeout for qpid-route in seconds
> +TIMEOUT=5
> # Source function library.
> . @sysconfdir(a)/rc.d/init.d/functions
>
> @@ -50,6 +52,44 @@ if [ -f @sysconfdir@/sysconfig/matahari-broker
> ] ; then fi
>
> RETVAL=0
> +# Enable broker federation
> +federate() {
> + unset array
> + declare -a array
> + for name in $@
I'm not sure if FEDERATED_BROKERS can contain any white space
character. If so, the $@ should be in "quotes". The same is for every
other variables.
The federated brokers should only be in the format of
1) test.hostname.com:49000
or
2)
_matahari-broker._tcp.hostname.com
Rather than quote the variables should we check if white space exists
and fail if so?
Thanks
Adam