summaryrefslogtreecommitdiff
path: root/src/common/mount-namespace.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/mount-namespace.cpp')
-rw-r--r--src/common/mount-namespace.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/common/mount-namespace.cpp b/src/common/mount-namespace.cpp
index b1283724..2b6a0f2d 100644
--- a/src/common/mount-namespace.cpp
+++ b/src/common/mount-namespace.cpp
@@ -123,7 +123,7 @@ std::string getUserAppServiceMountPointPath(uid_t uid, const std::string &smackL
return getUserAppMountPointPath(uid, smackLabel) + "/" + std::to_string(pid);
}
-bool isMountNamespaceEnabled(void)
+bool isPrivacyPrivilegeMountNamespaceEnabled(void)
{
auto getStatus = []() -> bool {
try {
@@ -135,6 +135,11 @@ bool isMountNamespaceEnabled(void)
return false;
if (st.st_size == 0)
return false;
+
+ // File exists and is not empty.
+ // Let's check if it contains any relevant configuration entries.
+ if (getPrivilegePathMap(getuid()).empty())
+ return false;
} catch (...) {
return false;
}
@@ -142,9 +147,9 @@ bool isMountNamespaceEnabled(void)
return true;
};
- static bool isMountNamespaceEnabled = getStatus();
+ static bool enabled = getStatus();
- return isMountNamespaceEnabled;
+ return enabled;
}
int createMountNamespace(void)