Date: Mon, 12 Jul 1999 23:20:20 -0400 (EDT) From: mi+qpopper@aldan.algebra.com To: FreeBSD-gnats-submit@freebsd.org Cc: qpopper@lists.pensive.org Subject: ports/12618: poor trouble reporting by qpopper's pop_init.c Message-ID: <199907130320.XAA21040@guest.newton>
next in thread | raw e-mail | index | archive | help
>Number: 12618 >Category: ports >Synopsis: poor trouble reporting by qpopper's pop_init.c >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jul 12 20:30:01 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Mikhail Teterin >Release: FreeBSD 3.2-STABLE i386 >Organization: Virtual Estates, Inc. >Environment: >Description: When the connecting client's IP address is unresolvable, the popper logs the following: (v2.53) Unable to get canonical name of client, err = 0 The actual bug is, it uses errno instead of h_errno here. The improvement I added replaces the numeric error codes with the actual error string by hstrerror(3) in this case, and by strerror(3) in several others in this file. It will also report the IP address of the client now (already available in p->ipaddr). >How-To-Repeat: Set up the popper, try to fetch mail from a non-resolvable IP address. Watch the log. >Fix: The patch below (suitable for patches/patch-am) addresses the bug and improves the error reporting in the pop_init.c. Other files can also be modified to report an error description instead of error code... The above quoted warning now looks as: (v2.53) Unable to get canonical name of client 10.10.0.10: Unknown host --- pop_init.c.orig Thu Jul 9 19:44:07 1998 +++ pop_init.c Mon Jul 12 22:56:01 1999 @@ -237,4 +237,4 @@ pop_log(p,POP_PRIORITY, - "Unable to open trace file \"%s\", err = %d", - optarg,errno); + "Unable to open trace file \"%s\": ", + optarg, strerror(errno)); exit(1); @@ -268,3 +268,4 @@ pop_log(p,POP_PRIORITY, - "Unable to obtain socket and address of client, err = %d",errno); + "Unable to obtain socket and address of client: %s", + strerror(errno)); exit(1); @@ -283,4 +284,4 @@ pop_log(p,POP_PRIORITY, - "(v%s) Unable to get canonical name of client, err = %d", - VERSION, errno); + "(v"VERSION") Unable to get canonical name of client %s: %s", + p->ipaddr, hstrerror(h_errno)); p->client = p->ipaddr; @@ -362,3 +363,4 @@ pop_log(p,POP_PRIORITY, - "Unable to open communication stream for input, err = %d",errno); + "Unable to open communication stream for input: ", + strerror(errno)); exit (1); @@ -369,3 +371,4 @@ pop_log(p,POP_PRIORITY, - "Unable to open communication stream for output, err = %d",errno); + "Unable to open communication stream for output: ", + strerror(errno)); exit (1); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199907130320.XAA21040>