]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
apparmor.c: drop newline when reading current profile
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 10 Sep 2013 22:23:22 +0000 (17:23 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 11 Sep 2013 14:21:28 +0000 (09:21 -0500)
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@ubuntu.com>
Reported-by: Andre nathan <andre@digirati.com.br>
src/lxc/apparmor.c

index 3941d3f7505c081473b7b33bbe75888abac9da3d..4dad801ff458462666339f7e1bc11f7369aec33f 100644 (file)
@@ -77,6 +77,9 @@ again:
                free(buf);
                return NULL;
        }
+       space = index(buf, '\n');
+       if (space)
+               *space = '\0';
        space = index(buf, ' ');
        if (space)
                *space = '\0';