mirror of
https://github.com/NixOS/nix.git
synced 2025-11-15 15:02:42 +01:00
canonicalisePathMetaData(): Ignore security.selinux attribute
Untested, hopefully fixes #1406.
(cherry picked from commit 88b291ffc4)
This commit is contained in:
parent
1e4885e316
commit
35ea3d62dc
1 changed files with 5 additions and 1 deletions
|
|
@ -592,10 +592,14 @@ static void canonicalisePathMetaData_(const Path & path, uid_t fromUid, InodesSe
|
|||
if ((eaSize = llistxattr(path.c_str(), eaBuf.data(), eaBuf.size())) < 0)
|
||||
throw SysError(format("querying extended attributes of ‘%s’") % path);
|
||||
|
||||
for (auto & eaName: tokenizeString<Strings>(std::string(eaBuf.data(), eaSize), std::string("\000", 1)))
|
||||
for (auto & eaName: tokenizeString<Strings>(std::string(eaBuf.data(), eaSize), std::string("\000", 1))) {
|
||||
/* Ignore SELinux security labels since these cannot be
|
||||
removed even by root. */
|
||||
if (eaName == "security.selinux") continue;
|
||||
if (lremovexattr(path.c_str(), eaName.c_str()) == -1)
|
||||
throw SysError(format("removing extended attribute ‘%s’ from ‘%s’") % eaName % path);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Fail if the file is not owned by the build user. This prevents
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue