Date: Mon, 2 Apr 2012 15:03:54 GMT From: "nkoch@demig.de" <nkoch@demig.de> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/166583: [PATCH] print/rlpr: allow ip-address in addition to hostname Message-ID: <201204021503.q32F3saB074445@red.freebsd.org> Resent-Message-ID: <201204021510.q32FA1l1073400@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204021503.q32F3saB074445>