[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
104/118: createDirs(): Handle ‘path’ being a symlink
From: |
Ludovic Courtès |
Subject: |
104/118: createDirs(): Handle ‘path’ being a symlink |
Date: |
Tue, 19 May 2015 14:46:00 +0000 |
civodul pushed a commit to branch nix
in repository guix.
commit c95742283595cb01b44ddc8e6ff5e9c1d66db444
Author: Eelco Dolstra <address@hidden>
Date: Fri Oct 3 16:53:28 2014 +0200
createDirs(): Handle ‘path’ being a symlink
In particular, this fixes "nix-build -o /tmp/result" on Mac OS X
(where /tmp is a symlink).
---
nix/libutil/util.cc | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/nix/libutil/util.cc b/nix/libutil/util.cc
index 54b9eb8..9af42a1 100644
--- a/nix/libutil/util.cc
+++ b/nix/libutil/util.cc
@@ -379,6 +379,9 @@ Paths createDirs(const Path & path)
created.push_back(path);
}
+ if (S_ISLNK(st.st_mode) && stat(path.c_str(), &st) == -1)
+ throw SysError(format("statting symlink `%1%'") % path);
+
if (!S_ISDIR(st.st_mode)) throw Error(format("`%1%' is not a directory") %
path);
return created;
- 78/118: Remove some dead code, (continued)
- 78/118: Remove some dead code, Ludovic Courtès, 2015/05/19
- 82/118: Eliminate redundant copy, Ludovic Courtès, 2015/05/19
- 95/118: Make hook shutdown more reliable, Ludovic Courtès, 2015/05/19
- 81/118: findRoots(): Prevent a call to lstat(), Ludovic Courtès, 2015/05/19
- 101/118: On Linux, disable address space randomization, Ludovic Courtès, 2015/05/19
- 91/118: Use regular file GC roots if possible, Ludovic Courtès, 2015/05/19
- 102/118: Remove bogus comment, Ludovic Courtès, 2015/05/19
- 80/118: Make readDirectory() return inode / file type, Ludovic Courtès, 2015/05/19
- 94/118: Doh, Ludovic Courtès, 2015/05/19
- 96/118: fix disappearing bash arguments, Ludovic Courtès, 2015/05/19
- 104/118: createDirs(): Handle ‘path’ being a symlink,
Ludovic Courtès <=
- 103/118: nix-daemon: Close unnecessary fd, Ludovic Courtès, 2015/05/19
- 97/118: Introduce allowedRequisites feature, Ludovic Courtès, 2015/05/19
- 113/118: Clean up temp roots in a more C++ way, Ludovic Courtès, 2015/05/19
- 105/118: Remove some duplicate code, Ludovic Courtès, 2015/05/19
- 108/118: Improve error message if the daemon worker fails to start, Ludovic Courtès, 2015/05/19
- 100/118: Settings: Add bool get(), Ludovic Courtès, 2015/05/19
- 106/118: Improved error message when encountering unsupported file types, Ludovic Courtès, 2015/05/19
- 114/118: nix-daemon: Call exit(), not _exit(), Ludovic Courtès, 2015/05/19
- 99/118: Add an 'optimiseStore' remote procedure call., Ludovic Courtès, 2015/05/19
- 107/118: Fix build on gcc < 4.7, Ludovic Courtès, 2015/05/19