[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-ha
Subject:    Re: [Linux-HA] "grep -zqs" in ocf:heartbeat:exportfs
From:       Lars Ellenberg <lars.ellenberg () linbit ! com>
Date:       2012-04-12 13:35:30
Message-ID: 20120412133530.GT9163 () barkeeper1-xen ! linbit
[Download RAW message or body]

On Thu, Apr 12, 2012 at 03:30:06PM +0200, Lars Ellenberg wrote:
> On Thu, Apr 12, 2012 at 03:20:08PM +0200, Ulrich Windl wrote:
> > Hi,
> > 
> > in ocf:heartbeat:exportfs (as found in SLES11 SP1) there is a problem with "grep \
> > -zqs": The "-z" is expected to fix the problem where exportfs splits a lenghty \
> > name into two lines. Unfortunately exportfs does not output any binary zeros that \
> > "grep -z" is looking for. Thus effectively "-z" makes grep succeed when it \
> > shouldn't. 
> > Source:
> > exportfs_monitor ()
> > {
> > # "grep -z" matches across newlines, which is necessary as
> > # exportfs output wraps lines for long export directory names
> > exportfs | grep -zqs \
> > "${OCF_RESKEY_directory}[[:space:]]*${OCF_RESKEY_clientspec}" [...]
> > 
> > Example (test):
> > # exportfs | grep -z h06
> > /home/windl/src/scripts/OCF/twuc/.git/objects/39
> > h02
> > /home/windl/src/scripts/OCF/twuc/.git/objects/39
> > h06
> > /mnt            h02
> > /mnt            h06
> > # exportfs | grep h06
> > h06
> > /mnt            h06
> > 
> > So you see "grep -z" does produce false results. Probably never tested...
> > BTW: Shouldn't the match be "anchored"? ^$directory ... $host\$
> 
> 
> https://github.com/ClusterLabs/resource-agents/commit/5b0bf96e77ed3c4e179c8b4c6a5ffd4709f8fdae
>  
> There also was a medium length discussion on the mailing list on that.

There:
http://www.gossamer-threads.com/lists/linuxha/dev/77166

-- 
> Lars Ellenberg
> LINBIT | Your Way to High Availability
> DRBD/HA support and consulting http://www.linbit.com
_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic