From c3cb8580407b6f6b49949e6c58e175eec81db692 Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Tue, 10 Sep 2013 17:23:22 -0500 Subject: [PATCH] apparmor.c: drop newline when reading current profile 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 Reported-by: Andre nathan --- src/lxc/apparmor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lxc/apparmor.c b/src/lxc/apparmor.c index 3941d3f75..4dad801ff 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'; -- 2.47.2