[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1429933137-11380-1-git-send-email-vapier@gentoo.org>
Date: Fri, 24 Apr 2015 23:38:57 -0400
From: Mike Frysinger <vapier@...too.org>
To: YOSHIFUJI Hideaki <yoshfuji@...ux-ipv6.org>
Cc: netdev@...r.kernel.org,
David Heidelberger <david.heidelberger@...t.cz>
Subject: [PATCH iputils] tftpd: fix syslog setup
Commit d81a44625b04d487c895473aa77af13420b7afdd added support for checking
the set*id calls, but would call syslog() before it had called openlog().
Move the call up earlier to fix that.
Signed-off-by: Mike Frysinger <vapier@...too.org>
---
tftpd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tftpd.c b/tftpd.c
index e3af2f4..7ddc8eb 100644
--- a/tftpd.c
+++ b/tftpd.c
@@ -109,6 +109,8 @@ int main(int ac, char **av)
register int n = 0;
int on = 1;
+ openlog("tftpd", LOG_PID, LOG_DAEMON);
+
/* Sanity. If parent forgot to setuid() on us. */
if (geteuid() == 0) {
if (setgid(65534)) {
@@ -125,7 +127,6 @@ int main(int ac, char **av)
while (ac-- > 0 && n < MAXARG)
dirs[n++] = *av++;
- openlog("tftpd", LOG_PID, LOG_DAEMON);
if (ioctl(0, FIONBIO, &on) < 0) {
syslog(LOG_ERR, "ioctl(FIONBIO): %m\n");
exit(1);
--
2.3.5
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists