summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2015-04-26 11:33:01 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2015-04-26 11:33:01 +0000
commit0ea28240053521a309698413a426b4d730a3d60c (patch)
tree8e7ba203010162f7fe341b7dfd3f0410718c32c2 /util
parent9145bbd450b41b3d36e63a815d45bf740a3e0230 (diff)
downloadsrc-test2-0ea28240053521a309698413a426b4d730a3d60c.tar.gz
src-test2-0ea28240053521a309698413a426b4d730a3d60c.zip
Merge upstream r3375 and r3376 which fix a segfault on startup when the
user specified in the configuration file does not exist. PR: 197534
Notes
Notes: svn path=/vendor/unbound/dist/; revision=282014
Diffstat (limited to 'util')
-rw-r--r--util/config_file.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/util/config_file.c b/util/config_file.c
index 5c4e897da373..9c427ed0d4f5 100644
--- a/util/config_file.c
+++ b/util/config_file.c
@@ -1211,10 +1211,10 @@ void config_lookup_uid(struct config_file* cfg)
/* 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;
+ if((pwd = getpwnam(cfg->username)) != NULL) {
+ cfg_uid = pwd->pw_uid;
+ cfg_gid = pwd->pw_gid;
+ }
}
#else
(void)cfg;