From: W.C.A. Wijngaards Date: Mon, 23 Nov 2020 13:17:58 +0000 (+0100) Subject: Fix writepid for retvalue 0. X-Git-Tag: release-1.13.0rc1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62152e0493a16a0d6caad8c62ecd723b2b5308bc;p=thirdparty%2Funbound.git Fix writepid for retvalue 0. --- diff --git a/daemon/unbound.c b/daemon/unbound.c index 0efa353da..bc6d2bc9e 100644 --- a/daemon/unbound.c +++ b/daemon/unbound.c @@ -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; } diff --git a/doc/Changelog b/doc/Changelog index 5bb0f05f3..5d158ef5d 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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,