diff options
Diffstat (limited to 'util')
| -rw-r--r-- | util/config_file.c | 25 | ||||
| -rw-r--r-- | util/config_file.h | 6 |
2 files changed, 21 insertions, 10 deletions
diff --git a/util/config_file.c b/util/config_file.c index bb39cf9bd7a2..3554e3fa0505 100644 --- a/util/config_file.c +++ b/util/config_file.c @@ -201,6 +201,7 @@ config_create(void) cfg->remote_control_enable = 0; cfg->control_ifs = NULL; cfg->control_port = UNBOUND_CONTROL_PORT; + cfg->remote_control_use_cert = 1; cfg->minimal_responses = 0; cfg->rrset_roundrobin = 0; cfg->max_udp_size = 4096; @@ -805,16 +806,6 @@ config_read(struct config_file* cfg, const char* filename, const char* chroot) return 0; } -#ifdef HAVE_GETPWNAM - /* translate username into uid and gid */ - if(cfg->username && cfg->username[0]) { - struct passwd *pwd; - if((pwd = getpwnam(cfg->username)) == NULL) - log_err("user '%s' does not exist.", cfg->username); - cfg->uid = pwd->pw_uid; - cfg->gid = pwd->pw_gid; - } -#endif return 1; } @@ -1203,6 +1194,20 @@ config_apply(struct config_file* config) log_set_time_asc(config->log_time_ascii); } +void config_lookup_uid(struct config_file* cfg) +{ +#ifdef HAVE_GETPWNAM + /* translate username into uid and gid */ + if(cfg->username && cfg->username[0]) { + struct passwd *pwd; + if((pwd = getpwnam(cfg->username)) == NULL) + log_err("user '%s' does not exist.", cfg->username); + cfg->uid = pwd->pw_uid; + cfg->gid = pwd->pw_gid; + } +#endif +} + /** * Calculate string length of full pathname in original filesys * @param fname: the path name to convert. diff --git a/util/config_file.h b/util/config_file.h index fd35d7863ae1..327eadc76f7b 100644 --- a/util/config_file.h +++ b/util/config_file.h @@ -427,6 +427,12 @@ void config_delete(struct config_file* config); void config_apply(struct config_file* config); /** + * Find username, sets uid and gid. + * @param config: the config structure. + */ +void config_lookup_uid(struct config_file* config); + +/** * Set the given keyword to the given value. * @param config: where to store config * @param option: option name, including the ':' character. |
