diff options
Diffstat (limited to 'src/libstore/local-fs-store.cc')
-rw-r--r-- | src/libstore/local-fs-store.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libstore/local-fs-store.cc b/src/libstore/local-fs-store.cc index 87c216ec9f95..303c3af27b8d 100644 --- a/src/libstore/local-fs-store.cc +++ b/src/libstore/local-fs-store.cc @@ -23,7 +23,7 @@ struct LocalStoreAccessor : public FSAccessor struct stat st; if (lstat(path.c_str(), &st)) { - if (errno == ENOENT) return {Type::tMissing, 0, false}; + if (errno == ENOENT || errno == ENOTDIR) return {Type::tMissing, 0, false}; throw SysError(format("getting status of ‘%1%’") % path); } @@ -69,9 +69,11 @@ ref<FSAccessor> LocalFSStore::getFSAccessor() return make_ref<LocalStoreAccessor>(ref<Store>(shared_from_this())); } -void LocalFSStore::dumpPath(const Path & path, Sink & sink) +void LocalFSStore::narFromPath(const Path & path, Sink & sink) { - nix::dumpPath(path, sink); + if (!isValidPath(path)) + throw Error(format("path ‘%s’ is not valid") % path); + dumpPath(path, sink); } } |