GCC Code Coverage Report


Directory: cvmfs/
File: cvmfs/publish/repository_env.cc
Date: 2026-05-03 02:36:16
Exec Total Coverage
Lines: 0 10 0.0%
Branches: 0 26 0.0%

Line Branch Exec Source
1 /**
2 * This file is part of the CernVM File System.
3 */
4
5
6 #include "publish/except.h"
7 #include "repository.h"
8 #include "util/capabilities.h"
9 #include "util/posix.h"
10
11 namespace publish {
12
13 void Env::DropCapabilities() {
14 // Because the process has file capabilities, its dumpable state is set to
15 // false, which in turn makes the /proc/self/... files owned by root. We
16 // need to reset this to have them owned by the effective UID in order to
17 // set, e.g., uid_map/gid_map of user namespaces.
18 if (!platform_set_dumpable())
19 throw EPublish("cannot set dumpable state");
20
21 const std::vector<cap_value_t> nocaps;
22 if (!ClearPermittedCapabilities(nocaps, nocaps))
23 throw EPublish("cannot clear process capabilities");
24 }
25
26
27 std::string Env::GetEnterSessionDir() {
28 if (SymlinkExists("/.cvmfsenter"))
29 return ResolvePath("/.cvmfsenter");
30 return "";
31 }
32
33 } // namespace publish
34