]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix to not ignore return value of chown() in daemon startup.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 3 Jun 2016 07:38:53 +0000 (07:38 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 3 Jun 2016 07:38:53 +0000 (07:38 +0000)
git-svn-id: file:///svn/unbound/trunk@3752 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/remote.c
doc/Changelog

index 7690ee8b18755c24e1f36a095d322c2e3276490e..7fac32d6b71784b1c3478b12ad6d22f0f902af1a 100644 (file)
@@ -359,8 +359,12 @@ add_open(const char* ip, int nr, struct listen_port** list, int noproto_is_err,
                if(fd != -1) {
 #ifdef HAVE_CHOWN
                        if (cfg->username && cfg->username[0] &&
-                               cfg_uid != (uid_t)-1)
-                               chown(ip, cfg_uid, cfg_gid);
+                               cfg_uid != (uid_t)-1) {
+                               if(chown(ip, cfg_uid, cfg_gid) == -1)
+                                       log_err("cannot chown %u.%u %s: %s",
+                                         (unsigned)cfg_uid, (unsigned)cfg_gid,
+                                         ip, strerror(errno));
+                       }
                        chmod(ip, (mode_t)(S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP));
 #else
                        (void)cfg;
index 62e639ddbbe306c8efa0d8f8e5f95dbf72c08903..705daf66001c47cbefb059259816e7f3ab809db5 100644 (file)
@@ -1,3 +1,6 @@
+3 June 2016: Wouter
+       - Fix to not ignore return value of chown() in daemon startup.
+
 2 June 2016: Wouter
        - Fix libubound for edns optlist feature.
        - Fix distinction between free and CRYPTO_free in dsa and ecdsa alloc.