From owner-freebsd-ports Mon Jul 12 20:30:17 1999 Delivered-To: freebsd-ports@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 235B414E08 for ; Mon, 12 Jul 1999 20:30:14 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id UAA04172; Mon, 12 Jul 1999 20:30:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from kot.ne.mediaone.net (kot.ne.mediaone.net [24.218.15.190]) by hub.freebsd.org (Postfix) with ESMTP id 79CEB14D5E for ; Mon, 12 Jul 1999 20:21:29 -0700 (PDT) (envelope-from mi@aldan.algebra.com) Received: from guest.newton (guest.newton [10.10.0.3]) by kot.ne.mediaone.net (8.9.3/8.9.1) with ESMTP id XAA06829; Tue, 13 Jul 1999 23:23:52 -0400 (EDT) Received: (from mi@localhost) by guest.newton (8.9.3/8.9.1) id XAA21040; Mon, 12 Jul 1999 23:20:20 -0400 (EDT) Message-Id: <199907130320.XAA21040@guest.newton> Date: Mon, 12 Jul 1999 23:20:20 -0400 (EDT) From: mi+qpopper@aldan.algebra.com Reply-To: mi+qpopper@aldan.algebra.com To: FreeBSD-gnats-submit@freebsd.org Cc: qpopper@lists.pensive.org X-Send-Pr-Version: 3.2 Subject: ports/12618: poor trouble reporting by qpopper's pop_init.c Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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