From 1f656cb2946083319f62b3e01e21fed59c0d19e5 Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Wed, 2 Feb 2000 07:56:18 +0000 Subject: [PATCH] Use O_NOFOLLOW when it's there, and needed. --- lib.c | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.40.0