aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-09-23 15:47:12 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-09-23 18:21:22 +0200
commitd4f8163d104aee0f39e6d8b98160f8de12c18824 (patch)
tree49ca81b615d5554ea646bfdfc5dfc91755df47a1 /src
parente8f0b1e996e95e4a1025976d6cfb7ece734129a2 (diff)
canonicalisePathMetaData_(): Change assertion to error message
Diffstat (limited to 'src')
-rw-r--r--src/libstore/local-store.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index c91f3fbf7..1f58977a5 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -478,8 +478,7 @@ static void canonicalisePathMetaData_(const Path & path, uid_t fromUid, InodesSe
ensure that we don't fail on hard links within the same build
(i.e. "touch $out/foo; ln $out/foo $out/bar"). */
if (fromUid != (uid_t) -1 && st.st_uid != fromUid) {
- assert(!S_ISDIR(st.st_mode));
- if (inodesSeen.find(Inode(st.st_dev, st.st_ino)) == inodesSeen.end())
+ if (S_ISDIR(st.st_mode) || !inodesSeen.count(Inode(st.st_dev, st.st_ino)))
throw BuildError("invalid ownership on file '%1%'", path);
mode_t mode = st.st_mode & ~S_IFMT;
assert(S_ISLNK(st.st_mode) || (st.st_uid == geteuid() && (mode == 0444 || mode == 0555) && st.st_mtime == mtimeStore));