Mount appfuse in process namespace.
BUG=26148108
Change-Id: I2297fd227a4c607054e0403e73bd9c857f580a1c
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index e26b6fe..9304630 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -471,18 +471,6 @@
return 0;
}
-static int sane_readlinkat(int dirfd, const char* path, char* buf, size_t bufsiz) {
- ssize_t len = readlinkat(dirfd, path, buf, bufsiz);
- if (len < 0) {
- return -1;
- } else if (len == (ssize_t) bufsiz) {
- return -1;
- } else {
- buf[len] = '\0';
- return 0;
- }
-}
-
static int unmount_tree(const char* path) {
size_t path_len = strlen(path);
@@ -529,7 +517,7 @@
}
// Figure out root namespace to compare against below
- if (sane_readlinkat(dirfd(dir), "1/ns/mnt", rootName, PATH_MAX) == -1) {
+ if (android::vold::SaneReadLinkAt(dirfd(dir), "1/ns/mnt", rootName, PATH_MAX) == -1) {
PLOG(ERROR) << "Failed to readlink";
closedir(dir);
return -1;
@@ -554,7 +542,7 @@
// Matches so far, but refuse to touch if in root namespace
LOG(DEBUG) << "Found matching PID " << de->d_name;
- if (sane_readlinkat(pidFd, "ns/mnt", pidName, PATH_MAX) == -1) {
+ if (android::vold::SaneReadLinkAt(pidFd, "ns/mnt", pidName, PATH_MAX) == -1) {
PLOG(WARNING) << "Failed to read namespace for " << de->d_name;
goto next;
}