diff options
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/remote.c | 4 | ||||
-rw-r--r-- | daemon/unbound.c | 4 | ||||
-rw-r--r-- | daemon/worker.c | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/daemon/remote.c b/daemon/remote.c index a5be6d6..7a8fdb7 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -327,9 +327,13 @@ add_open(const char* ip, int nr, struct listen_port** list, int noproto_is_err, * group as the user we run as. */ if(fd != -1) { +#ifdef HAVE_CHOWN if (cfg->username && cfg->username[0]) chown(ip, cfg->uid, cfg->gid); chmod(ip, (mode_t)(S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP)); +#else + (void)cfg; +#endif } } else { hints.ai_socktype = SOCK_STREAM; diff --git a/daemon/unbound.c b/daemon/unbound.c index a31b039..f6bd924 100644 --- a/daemon/unbound.c +++ b/daemon/unbound.c @@ -504,16 +504,18 @@ perform_setup(struct daemon* daemon, struct config_file* cfg, int debug_mode, if(cfg->pidfile && cfg->pidfile[0]) { writepid(daemon->pidfile, getpid()); if(cfg->username && cfg->username[0]) { +# ifdef HAVE_CHOWN if(chown(daemon->pidfile, cfg->uid, cfg->gid) == -1) { log_err("cannot chown %u.%u %s: %s", (unsigned)cfg->uid, (unsigned)cfg->gid, daemon->pidfile, strerror(errno)); } +# endif /* HAVE_CHOWN */ } } #else (void)daemon; -#endif +#endif /* HAVE_KILL */ /* Set user context */ #ifdef HAVE_GETPWNAM diff --git a/daemon/worker.c b/daemon/worker.c index 59ae9df..5edc21d 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -900,7 +900,7 @@ worker_handle_request(struct comm_point* c, void* arg, int error, goto send_reply; } if(local_zones_answer(worker->daemon->local_zones, &qinfo, &edns, - c->buffer, worker->scratchpad)) { + c->buffer, worker->scratchpad, repinfo)) { regional_free_all(worker->scratchpad); if(sldns_buffer_limit(c->buffer) == 0) { comm_point_drop_reply(repinfo); |