Module Name: src
Committed By: lukem
Date: Sun Sep 4 23:16:42 UTC 2011
Modified Files:
src/libexec/ftpd: ftpd.c
Log Message:
Reduce priority of syslog message if getpeername returns ENOTCONN.
PR bin/18934 by Greg A. Woods (with supplied fix).
To generate a diff of this commit:
cvs rdiff -u -r1.195 -r1.196 src/libexec/ftpd/ftpd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/libexec/ftpd/ftpd.c
diff -u src/libexec/ftpd/ftpd.c:1.195 src/libexec/ftpd/ftpd.c:1.196
--- src/libexec/ftpd/ftpd.c:1.195 Mon Aug 29 20:41:06 2011
+++ src/libexec/ftpd/ftpd.c Sun Sep 4 23:16:41 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ftpd.c,v 1.195 2011/08/29 20:41:06 joerg Exp $ */
+/* $NetBSD: ftpd.c,v 1.196 2011/09/04 23:16:41 lukem Exp $ */
/*
* Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
#if 0
static char sccsid[] = "@(#)ftpd.c 8.5 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: ftpd.c,v 1.195 2011/08/29 20:41:06 joerg Exp $");
+__RCSID("$NetBSD: ftpd.c,v 1.196 2011/09/04 23:16:41 lukem Exp $");
#endif
#endif /* not lint */
@@ -601,7 +601,8 @@
memset((char *)&his_addr, 0, sizeof(his_addr));
addrlen = sizeof(his_addr.si_su);
if (getpeername(0, (struct sockaddr *)&his_addr.si_su, &addrlen) < 0) {
- syslog(LOG_ERR, "getpeername (%s): %m",argv[0]);
+ syslog((errno == ENOTCONN) ? LOG_NOTICE : LOG_ERR,
+ "getpeername (%s): %m",argv[0]);
exit(1);
}
his_addr.su_len = addrlen;