summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2000-02-02 07:56:18 +0000
committerThomas Roessler <roessler@does-not-exist.org>2000-02-02 07:56:18 +0000
commit1f656cb2946083319f62b3e01e21fed59c0d19e5 (patch)
tree2c79c7d9073326d96c2477ca7ffb2e04110604ea /lib.c
parent4ae449cbb74944e5729ce12b332acdba4a91d92f (diff)
Use O_NOFOLLOW when it's there, and needed.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index fb80d5f3..1d56365e 100644
--- a/lib.c
+++ b/lib.c
@@ -354,6 +354,10 @@ FILE *safe_fopen (const char *path, const char *mode)
int fd;
int flags = O_CREAT | O_EXCL;
+#ifdef O_NOFOLLOW
+ flags |= O_NOFOLLOW;
+#endif
+
if (mode[1] == '+')
flags |= O_RDWR;
else