Hi Hideo-san!

On 2012-05-11 02:09, renayama19661...@ybb.ne.jp wrote:
> Hi Raoul,
> Hi Dejan,
>
> Thank you for the reflection to a repository.
>
> To Raoul :
>   The matter of the next email is still left.
>   Please tell your opinion.
>   * http://www.gossamer-threads.com/lists/linuxha/dev/76409

I think the only patch left is postfix.patch.1121 from
http://www.gossamer-threads.com/lists/linuxha/dev/76532#76532 right?

> diff -r aaf72a017c98 postfix
> --- a/postfix Mon Nov 21 10:32:33 2011 +0900
> +++ b/postfix Mon Nov 21 10:34:08 2011 +0900
> @@ -264,7 +264,13 @@
>          fi
>
>          if ocf_is_true $status_support; then
> -            data_dir=`postconf $OPTION_CONFIG_DIR -h data_directory 
> 2>/dev/null`
> +            orig_data_dir=`postconf $OPTION_CONFIG_DIR -h data_directory 
> 2>/dev/null`
> +            data_dir=`echo $orig_data_dir | tr ',' ' '`
> +            dcount=`echo $data_dir | wc -w`
> +            if [ $dcount -gt 1 ]; then
> +                    ocf_log err "Postfix data directory '$orig_data_dir' 
> cannot set plural parameters."
> +                    return $OCF_ERR_PERM
> +            fi
>              if [ ! -d "$data_dir" ]; then
>                  if ocf_is_probe; then
>                      ocf_log info "Postfix data directory '$data_dir' not 
> readable during probe."

i would slightly modify this:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/heartbeat/postfix b/heartbeat/postfix
index 273d5c9..2f4ab13 100755
--- a/heartbeat/postfix
+++ b/heartbeat/postfix
@@ -264,6 +264,11 @@ postfix_validate_all()

          if ocf_is_true $status_support; then
              data_dir=`postconf $OPTION_CONFIG_DIR -h data_directory 
2>/dev/null`
+            data_dir_count=`echo "$data_dir" | tr ',' ' ' | wc -w`
+            if [ $data_dir_count -gt 1 ]; then
+               ocf_log err "Postfix data directory '$orig_data_dir' 
cannot be set to multiple directories."
+                return $OCF_ERR_INSTALLED
+            fi
              if [ ! -d "$data_dir" ]; then
                  if ocf_is_probe; then
                      ocf_log info "Postfix data directory '$data_dir' 
not readable during probe."

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

what do you think about that?

> @@ -278,16 +284,14 @@
>          # check directory permissions
>          if ocf_is_true $status_support; then
>              user=`postconf $OPTION_CONFIG_DIR -h mail_owner 2>/dev/null`
> -            for dir in "$data_dir"; do
> -                if ! su -s /bin/sh - $user -c "test -w $dir"; then
> -                    if ocf_is_probe; then
> -                        ocf_log info "Directory '$dir' is not writable by 
> user '$user' during probe."
> -                    else
> -                        ocf_log err "Directory '$dir' is not writable by 
> user '$user'."
> -                        return $OCF_ERR_PERM;
> -                    fi
> +            if ! su -s /bin/sh - $user -c "test -w $data_dir"; then
> +                if ocf_is_probe; then
> +                    ocf_log info "Directory '$data_dir' is not writable by 
> user '$user' during probe."
> +                else
> +                    ocf_log err "Directory '$data_dir' is not writable by 
> user '$user'."
> +                    return $OCF_ERR_PERM;
>                  fi
> -            done
> +            fi
>          fi
>      fi
>

As outlined, i see no benefit in removing the loop and would like to
keep it in case we want to check some other directories in the future.

quoting http://www.gossamer-threads.com/lists/linuxha/dev/76453#76453 :

>> the current loop:
>>> for dir in "$data_dir"; do
>>> ...
>>> done
>> (looping exactly one dir)
>>
>> could easily be enhanced to check more dirs, e.g.:
>>> for dir in "$data_dir" "$data_dir/active" "$data_dir/incoming"; do
>>> ...
>>> done
>> (looping three dirs)
>>
>> without having to re-introduce the loop.

Cheers,
Raoul
-- 
____________________________________________________________________
DI (FH) Raoul Bhatia M.Sc.          email.          r.bha...@ipax.at
Technischer Leiter

IPAX - Aloy Bhatia Hava OG          web.          http://www.ipax.at
Barawitzkagasse 10/2/2/11           email.            off...@ipax.at
1190 Wien                           tel.               +43 1 3670030
FN 277995t HG Wien                  fax.            +43 1 3670030 15
____________________________________________________________________


_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to