acl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Acl-devel] [PATCH] libacl: Fix acl_from_text() returning NULL on al


From: Mike Frysinger
Subject: Re: [Acl-devel] [PATCH] libacl: Fix acl_from_text() returning NULL on all input
Date: Sun, 21 Jan 2018 00:39:16 -0500

On 20 Apr 2017 17:42, Dmitry V. Levin wrote:
> On Thu, Apr 20, 2017 at 04:26:53PM +0200, Andreas Gruenbacher wrote:
> > On Thu, Apr 20, 2017 at 2:40 AM, Dmitry V. Levin <address@hidden> wrote:
> > > Commit 5dac69ce914202c587f00da638123403111ca673 introduced a regression:
> > > apparently, gcc treats
> > >   #pragma GCC diagnostic pop
> > > as a kind of statement, so this causes parse_acl_entry()
> > > to return -1 unconditionally, and therefore causes acl_from_text()
> > > to return NULL unconditionally, too.
> > >
> > > Fix this by moving the pragma after the "if" statement.
> > 
> > That's interesting. I've applied the fix, thanks.
> > 
> > > Reported-by: Valery Inozemtsev <address@hidden>
> > > ---
> > >  libacl/acl_from_text.c | 2 +-
> > >  test/misc.test         | 1 +
> > >  2 files changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/libacl/acl_from_text.c b/libacl/acl_from_text.c
> > > index bb2ab04..09790c9 100644
> > > --- a/libacl/acl_from_text.c
> > > +++ b/libacl/acl_from_text.c
> > > @@ -307,8 +307,8 @@ create_entry:
> > >  #pragma GCC diagnostic push
> > >  #pragma GCC diagnostic ignored "-Waddress"
> > >         if (acl_copy_entry(entry_d, int2ext(&entry_obj)) != 0)
> > > -#pragma GCC diagnostic pop
> > >                 return -1;
> > > +#pragma GCC diagnostic pop
> > >         return 0;
> > >
> > >  fail:
> > > diff --git a/test/misc.test b/test/misc.test
> > > index c4d9774..3d39b42 100644
> > > --- a/test/misc.test
> > > +++ b/test/misc.test
> > > @@ -8,6 +8,7 @@ two dummy users (bin and daemon) and a dummy group 
> > > (daemon).
> > >         $ touch f
> > >
> > >  Only change a base ACL:
> > > +       $ chacl u::rw,g::r,o::- f
> > 
> > What's this? Skipped ...
> 
> It's a regression test for the fix.

i've merged it then, thanks
-mike

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]