ports/166583: [PATCH] print/rlpr: allow ip-address in addition to hostname

nkoch at demig.de nkoch at demig.de
Mon Apr 2 15:10:01 UTC 2012


>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 at 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:



More information about the freebsd-ports-bugs mailing list