]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix that when the server truncates the pidfile, it does not follow
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 27 Mar 2024 13:07:54 +0000 (14:07 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 27 Mar 2024 13:07:54 +0000 (14:07 +0100)
  symbolic links.

daemon/unbound.c
doc/Changelog

index 457a08032857eb23fa260d13f8f0da80aa5a41e8..b5c7a0d20138388c654b8f46ffbd0081242d9a63 100644 (file)
@@ -746,7 +746,11 @@ run_daemon(const char* cfgfile, int cmdline_verbose, int debug_mode, int need_pi
        if(daemon->pidfile) {
                int fd;
                /* truncate pidfile */
-               fd = open(daemon->pidfile, O_WRONLY | O_TRUNC, 0644);
+               fd = open(daemon->pidfile, O_WRONLY | O_TRUNC
+#ifdef O_NOFOLLOW
+                       | O_NOFOLLOW
+#endif
+                       , 0644);
                if(fd != -1)
                        close(fd);
                /* delete pidfile */
index 3fbd270269ad575fc0fc03fb4f941bbac00de853..05be2e56fac661a754836feff9118685b71f84a7 100644 (file)
@@ -5,6 +5,8 @@
        - Fix for #1032, add safeguard to make table space positive.
        - Fix comment in lruhash space function.
        - Fix to add unit test for lruhash space that exercises the routines.
+       - Fix that when the server truncates the pidfile, it does not follow
+         symbolic links.
 
 25 March 2024: Yorgos
        - Merge #831 from Pierre4012: Improve Windows NSIS installer