summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
Diffstat (limited to 'daemon')
-rw-r--r--daemon/remote.c5
-rw-r--r--daemon/unbound.c3
2 files changed, 5 insertions, 3 deletions
diff --git a/daemon/remote.c b/daemon/remote.c
index a1d2628a904a..a5be6d68c882 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -142,6 +142,7 @@ timeval_divide(struct timeval* avg, const struct timeval* sum, size_t d)
* The following function was generated using the openssl utility, using
* the command : "openssl dhparam -dsaparam -C 512"
*/
+#ifndef S_SPLINT_S
DH *get_dh512()
{
static unsigned char dh512_p[]={
@@ -170,6 +171,7 @@ DH *get_dh512()
dh->length = 160;
return(dh);
}
+#endif /* SPLINT */
struct daemon_remote*
daemon_remote_create(struct config_file* cfg)
@@ -299,6 +301,7 @@ void daemon_remote_delete(struct daemon_remote* rc)
* @param nr: port nr
* @param list: list head
* @param noproto_is_err: if lack of protocol support is an error.
+ * @param cfg: config with username for chown of unix-sockets.
* @return false on failure.
*/
static int
@@ -326,7 +329,7 @@ add_open(const char* ip, int nr, struct listen_port** list, int noproto_is_err,
if(fd != -1) {
if (cfg->username && cfg->username[0])
chown(ip, cfg->uid, cfg->gid);
- chmod(ip, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
+ chmod(ip, (mode_t)(S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP));
}
} else {
hints.ai_socktype = SOCK_STREAM;
diff --git a/daemon/unbound.c b/daemon/unbound.c
index e48a6b5ea951..a31b0392ffdb 100644
--- a/daemon/unbound.c
+++ b/daemon/unbound.c
@@ -441,8 +441,6 @@ static void
perform_setup(struct daemon* daemon, struct config_file* cfg, int debug_mode,
const char** cfgfile)
{
- log_assert(cfg);
-
#ifdef HAVE_GETPWNAM
struct passwd *pwd = NULL;
@@ -653,6 +651,7 @@ run_daemon(const char* cfgfile, int cmdline_verbose, int debug_mode)
log_warn("Continuing with default config settings");
}
apply_settings(daemon, cfg, cmdline_verbose, debug_mode);
+ config_lookup_uid(cfg);
/* prepare */
if(!daemon_open_shared_ports(daemon))