]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fix writepid for retvalue 0.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 23 Nov 2020 13:17:58 +0000 (14:17 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 23 Nov 2020 13:17:58 +0000 (14:17 +0100)
daemon/unbound.c
doc/Changelog

index 0efa353da59e9ebb9c3460c42868c5885ff39ca9..bc6d2bc9efc542d7e74e2e2a0e5bfa73f4746ee4 100644 (file)
@@ -365,6 +365,11 @@ writepid (const char* pidfile, pid_t pid)
                                pidfile, strerror(errno));
                        close(fd);
                        return 0;
+               } else if(r == 0) {
+                       log_err("cannot write any bytes to pidfile %s: "
+                               "write returns 0 bytes written", pidfile);
+                       close(fd);
+                       return 0;
                }
                count += r;
        }
index 5bb0f05f30cda0255a1f6324d280e2ac8fa6d087..5d158ef5d474ba46a91183324dde622ea992ca0a 100644 (file)
@@ -8,6 +8,7 @@
        - Option to toggle udp-connect, default is enabled.
        - Fix for #303 CVE-2020-28935 : Fix that symlink does not interfere
          with chown of pidfile.
+       - Further fix for it and retvalue 0 fix for it.
 
 12 November 2020: Wouter
        - Fix to connect() to UDP destinations, default turned on,