From: Serge Hallyn Date: Tue, 10 Sep 2013 22:23:22 +0000 (-0500) Subject: apparmor.c: drop newline when reading current profile X-Git-Tag: lxc-1.0.0.alpha2~133 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c3cb8580407b6f6b49949e6c58e175eec81db692;p=thirdparty%2Flxc.git 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 --- 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';