From 83e4b735962df746c167bb1fd195dc17b184fb19 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Tue, 6 Feb 2018 16:57:15 +0000 Subject: [PATCH] Remove confusion between --user and --script-user. --- src/dnsmasq.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dnsmasq.c b/src/dnsmasq.c index ad01944..1ae7aad 100644 --- a/src/dnsmasq.c +++ b/src/dnsmasq.c @@ -388,10 +388,12 @@ int main (int argc, char **argv) daemon->scriptuser && (daemon->lease_change_command || daemon->luascript)) { - if ((ent_pw = getpwnam(daemon->scriptuser))) + struct passwd *scr_pw; + + if ((scr_pw = getpwnam(daemon->scriptuser))) { - script_uid = ent_pw->pw_uid; - script_gid = ent_pw->pw_gid; + script_uid = scr_pw->pw_uid; + script_gid = scr_pw->pw_gid; } else baduser = daemon->scriptuser; @@ -541,7 +543,7 @@ int main (int argc, char **argv) { if (!read_write(fd, (unsigned char *)daemon->namebuff, strlen(daemon->namebuff), 0)) err = 1; - else + else { while (retry_send(close(fd))); if (errno != 0)