[apparmor] [patch 1/2] fix: incorrect test of open return value

Steve Beattie steve at nxnw.org
Sat Oct 25 20:20:13 UTC 2014


On Sat, Oct 25, 2014 at 04:15:18PM -0400, john.johansen at canonical.com wrote:
> Signed-off-by: John Johansen <john.johansen at canonical.com>

Acked-by: Steve Beattie <steve at nxnw.org>

Thanks.

> ---
>  parser/network.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- 3.0-diff.orig/parser/network.c
> +++ 3.0-diff/parser/network.c
> @@ -164,7 +164,7 @@
>  		return net_af_max_override;
>  
>  	fd = open(PROC_VERSION, O_RDONLY);
> -	if (!fd)
> +	if (fd == -1)
>  		/* fall back to default provided during build */
>  		return 0;
>  	res = read(fd, &buffer, sizeof(buffer) - 1);
> 
> 

-- 
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/20141025/f1c01d1b/attachment.pgp>


More information about the AppArmor mailing list