From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Apr 2 15:10:01 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5F241065672 for ; Mon, 2 Apr 2012 15:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5DB788FC17 for ; Mon, 2 Apr 2012 15:10:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q32FA1oO073401 for ; Mon, 2 Apr 2012 15:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q32FA1l1073400; Mon, 2 Apr 2012 15:10:01 GMT (envelope-from gnats) Resent-Date: Mon, 2 Apr 2012 15:10:01 GMT Resent-Message-Id: <201204021510.q32FA1l1073400@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "nkoch@demig.de" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18FD9106567A for ; Mon, 2 Apr 2012 15:03:55 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id EFA888FC24 for ; Mon, 2 Apr 2012 15:03:54 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q32F3skK074469 for ; Mon, 2 Apr 2012 15:03:54 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q32F3saB074445; Mon, 2 Apr 2012 15:03:54 GMT (envelope-from nobody) Message-Id: <201204021503.q32F3saB074445@red.freebsd.org> Date: Mon, 2 Apr 2012 15:03:54 GMT From: "nkoch@demig.de" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/166583: [PATCH] print/rlpr: allow ip-address in addition to hostname X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Apr 2012 15:10:01 -0000 >Number: 166583 >Category: ports >Synopsis: [PATCH] print/rlpr: allow ip-address in addition to hostname >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Apr 02 15:10:01 UTC 2012 >Closed-Date: >Last-Modified: >Originator: nkoch@demig.de >Release: any >Organization: >Environment: n/a >Description: rlpr only accepts hostnames as parameter for e.g. -H. The patch first checks for a valid ip address using inet_aton() and then for a hostname. This works for my network-connected hp laser printer. I am subitting this here because the port's main web site is unreachable. >How-To-Repeat: >Fix: --- src/util.c Thu Oct 29 08:40:13 1999 +++ src/util.c Mon Apr 2 09:19:43 2012 @@ -73,6 +73,9 @@ sin->sin_port = port_hbo ? htons(port_hbo) : 0; if (host != 0) { + if (inet_aton (host, &sin->sin_addr) == 1) { + return 1; + } if ((hp = gethostbyname(host)) == 0) { msg(R_ERROR, 0, "gethostbyname(%s): %s", host, h_strerror()); Patch attached with submission follows: --- src/util.c Thu Oct 28 08:40:13 1999 +++ src/util.c Mon Apr 2 09:19:43 2012 @@ -73,6 +73,9 @@ sin->sin_port = port_hbo ? htons(port_hbo) : 0; if (host != 0) { + if (inet_aton (host, &sin->sin_addr) == 1) { + return 1; + } if ((hp = gethostbyname(host)) == 0) { msg(R_ERROR, 0, "gethostbyname(%s): %s", host, h_strerror()); >Release-Note: >Audit-Trail: >Unformatted: