On Thu, 20 Aug 2009 15:18:51 +0200
Herbert Poetzl <herbert@13thfloor.at> wrote:
> On Wed, Aug 19, 2009 at 01:48:33PM -0500, Corey Wright wrote:
> > change expected result to fail (0 -> 1) as trying to execute chattr on a
> > barrier from context 2 is expected to fail.
> >
> > this test is problematic because some versions of chattr (e2fsprogs
> > 1.40.8-2ubuntu2 in ubuntu hardy) return success even though the barrier
> > is not visible to chattr (ie "chattr: No such file or directory while
> > trying to stat <barrier>"). so even though chattr failed to act on the
> > barrier (as it could not see it), it still reports success (ie exit
> > code 0).
> >
> > todo/suggestion: first stat the barrier and only try to chattr the
> > barrier if stat is successful (because if stat fails, then chattr will
> > definitely fail).
>
> should probably be the other way round, i.e.
> chattr && stat
> so that the chattr is executed in any case, and
> the effect on the directory can be checked in
> a second step ...
how about exec'ing chattr instead of eval'ing it (as chattr is too buggy to
test with) and instead test the xattrs (using showattr & lsattr as done
elsewhere in the code) after the attempted chattr to insure it didn't change
them?
(see comment/explanation at top of patch.)
corey
-- undefined@pobox.com