Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions common/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,9 @@ auto MakeTmpDirWithPrefix(std::filesystem::path prefix)

// The permissions must be exactly 0700 for a temporary directory, and the UID
// should be ours.
// Note: The `&&` below only rejects the directory when *both* the permissions
// and the UID are unexpected. If the intended security requirement is to
// reject when *either* differs, this condition would need to use `||`.
if (stat.permissions() != 0700 && stat.unix_uid() != geteuid()) {
return Error(
llvm::formatv("Found incorrect permissions or UID on tmpdir '{0}'",
Expand Down
Loading