[lxc-devel] [PATCH] apparmor.c: drop newline when reading current profile

Serge Hallyn serge.hallyn at ubuntu.com
Tue Sep 10 22:23:22 UTC 2013


Otherwise we fail to recognize if we are already unconfined.  Then,
if we want to *start* unconfined, and /proc is readonly, start fails
even though it should be able to proceed.

With this patch, that situation works.

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Reported-by: Andre nathan <andre at digirati.com.br>
---
 src/lxc/apparmor.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lxc/apparmor.c b/src/lxc/apparmor.c
index 3941d3f..4dad801 100644
--- a/src/lxc/apparmor.c
+++ b/src/lxc/apparmor.c
@@ -77,6 +77,9 @@ again:
 		free(buf);
 		return NULL;
 	}
+	space = index(buf, '\n');
+	if (space)
+		*space = '\0';
 	space = index(buf, ' ');
 	if (space)
 		*space = '\0';
-- 
1.8.1.2





More information about the lxc-devel mailing list