From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabio M. Di Nitto Date: Fri, 28 Oct 2011 06:46:02 +0200 Subject: [Cluster-devel] [PATCH] resource-agents: nfsclient: fix wildcard status checks [RHEL5] In-Reply-To: <1319768780-2769-1-git-send-email-lhh@redhat.com> References: <1319768780-2769-1-git-send-email-lhh@redhat.com> Message-ID: <4EAA338A.7070408@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ACK Fabio On 10/28/2011 04:26 AM, Lon Hohberger wrote: > Several permutations of nfsclients with options were > not checked correctly due to bad pattern matching. > > Resolves: rhbz#700103 > > Signed-off-by: Lon Hohberger > --- > rgmanager/src/resources/nfsclient.sh | 20 ++++++++++++-------- > 1 files changed, 12 insertions(+), 8 deletions(-) > > diff --git a/rgmanager/src/resources/nfsclient.sh b/rgmanager/src/resources/nfsclient.sh > index 138370d..42ed2ce 100755 > --- a/rgmanager/src/resources/nfsclient.sh > +++ b/rgmanager/src/resources/nfsclient.sh > @@ -391,8 +391,8 @@ status|monitor) > exportfs -v > $tmpfn > fi > > - cat $tmpfn | tr -d "\n" | sed -e 's/([^)]*)/\n/g' | grep -iq \ > - "^${OCF_RESKEY_path}[\t ]*.*${OCF_RESKEY_target_regexp}" > + cat $tmpfn | tr -d "\n" | sed -e 's/([^)]*)/\n/g' | grep -Piq \ > + "^${OCF_RESKEY_path}[\t ]+${OCF_RESKEY_target_regexp}" > rv=$? > > if [ $rv -eq 0 ]; then > @@ -400,15 +400,19 @@ status|monitor) > exit 0 > fi > > - declare OCF_RESKEY_target_tmp=$(clufindhostname -i "$OCF_RESKEY_target") > + declare OCF_RESKEY_target_tmp > + OCF_RESKEY_target_tmp=$(clufindhostname -i "$OCF_RESKEY_target") > if [ $? -ne 0 ]; then > - [ "$OCF_RESKEY_use_cache" = "1" ] || rm -f $tmpfn > - ocf_log err "nfsclient:$OCF_RESKEY_name is missing!" > - exit 1 > + OCF_RESKEY_target_tmp=$(clufindhostname -n "$OCF_RESKEY_target") > + if [ $? -ne 0 ]; then > + [ "$OCF_RESKEY_use_cache" = "1" ] || rm -f $tmpfn > + ocf_log err "nfsclient:$OCF_RESKEY_name is missing!" > + exit 1 > + fi > fi > > - cat $tmpfn | tr -d "\n" | sed -e 's/([^)]*)/\n/g' | grep -q \ > - "^${OCF_RESKEY_path}[\t ]*.*${OCF_RESKEY_target_tmp}" > + cat $tmpfn | tr -d "\n" | sed -e 's/([^)]*)/\n/g' | grep -Pq \ > + "^${OCF_RESKEY_path}[\t ]+${OCF_RESKEY_target_tmp}" > rv=$? > > [ "$OCF_RESKEY_use_cache" = "1" ] || rm -f $tmpfn