[apparmor] [PATCH] parser: Fix return value of dirat_for_each()

Steve Beattie steve at nxnw.org
Sat Feb 28 00:28:39 UTC 2015


On Wed, Feb 25, 2015 at 12:01:33PM -0600, Tyler Hicks wrote:
> Seth pointed out that dirat_for_each() didn't correctly handle the
> return value from readdir_r(). On error, it directly returns a positive
> errno value. This would have resulted in that positive errno value being
> returned, with an undefined errno value set, from dirat_for_each().
> However, the dirat_for_each() documentation states that -1 is returned,
> with errno set, on error.
> 
> This patch results in readdir_r()'s return value being handled
> appropriately. In addition, it ensures that 0 is always returned on
> success.
> 
> Signed-off-by: Tyler Hicks <tyhicks at canonical.com>
> Reported-by: Seth Arnold <seth.arnold at canonical.com>

Acked-by: Steve Beattie <steve at nxnw.org>. I'm okay with this going into
2.9 as well.

Thanks!

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20150227/9f906332/attachment.pgp>


More information about the AppArmor mailing list