[apparmor] [patch 16/XX] parser+af_unix: fix another location where peer_addr was intended but addr was used

Steve Beattie steve at nxnw.org
Mon Aug 25 15:39:09 UTC 2014


This patch fixes a segfault that was occurring in testing over the
weekend. The problem existed in the original patch that adds af_unix
rules (patch 06), but this patch applies at the end of the sequence
after the conversion from 'path' to 'addr' occurs, to simplify things a
bit.

Signed-off-by: Steve Beattie <steve at nxnw.org>
---
 parser/af_unix.cc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: b/parser/af_unix.cc
===================================================================
--- a/parser/af_unix.cc
+++ b/parser/af_unix.cc
@@ -83,7 +83,7 @@ void unix_rule::move_peer_conditionals(s
 		}
 		if (strcmp(ent->name, "addr") == 0) {
 			move_conditional_value("unix", &peer_addr, ent);
-			if (peer_addr[0] != '@' && strcmp(addr, "none") != 0)
+			if (peer_addr[0] != '@' && strcmp(peer_addr, "none") != 0)
 				yyerror("unix rule: invalid value for addr='%s'\n", peer_addr);
 		}
 	}


-- 
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/20140825/aa2aeb1f/attachment.pgp>


More information about the AppArmor mailing list