apparmor: fix disconnected bind mnts reconnection

Bind mounts can fail to be properly reconnected when PATH_CONNECT is
specified. Ensure that when PATH_CONNECT is specified the path has
a root.

BugLink: http://bugs.launchpad.net/bugs/1319984

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
This commit is contained in:
John Johansen 2014-07-25 04:02:08 -07:00
parent d671e89020
commit f2e561d190
1 changed files with 4 additions and 1 deletions

View File

@ -141,7 +141,10 @@ static int d_namespace_path(const struct path *path, char *buf, int buflen,
error = -EACCES;
if (*res == '/')
*name = res + 1;
}
} else if (*res != '/')
/* CONNECT_PATH with missing root */
error = prepend(name, *name - buf, "/", 1);
}
out: