Bug 166583 - [PATCH] print/rlpr: allow ip-address in addition to hostname
Summary: [PATCH] print/rlpr: allow ip-address in addition to hostname
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Mikhail Teterin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-02 16:10 UTC by nkoch
Modified: 2012-04-02 17:11 UTC (History)
0 users

See Also:


Attachments
file.diff (373 bytes, patch)
2012-04-02 16:10 UTC, nkoch
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description nkoch 2012-04-02 16:10:01 UTC
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.

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:
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-04-02 16:10:15 UTC
Responsible Changed
From-To: freebsd-ports-bugs->mi

mi@aldan.algebra.com => mi@ (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2012-04-02 16:10:18 UTC
Maintainer of print/rlpr,

Please note that PR ports/166583 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/166583

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2012-04-02 16:10:20 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 dfilter service freebsd_committer freebsd_triage 2012-04-02 17:01:38 UTC
mi          2012-04-02 16:01:25 UTC

  FreeBSD ports repository

  Modified files:
    print/rlpr           Makefile pkg-descr 
  Added files:
    print/rlpr/files     patch-ip-addr 
  Removed files:
    print/rlpr           pkg-plist 
  Log:
  Add a patch to allow specifying remote printer by IP-address, rather
  than only by hostname. Bump PORTREVISION.
  
  PR:     ports/166583
  Submitted by:   Norbert Koch
  
  While here:
          * replace the (short) pkg-plist with PLIST_FILES variable;
          * relax permissions on the client binaries from 4511 to 4555 --
            otherwise tar refuses to package them, when running as non-root;
          * declare license (GPLv2);
          * link to description page, that works (author's site is down);
          * add some working mirrors (author's site is down).
  
  Feature safe:   yes
  
  Revision  Changes    Path
  1.24      +8 -3      ports/print/rlpr/Makefile
  1.1       +16 -0     ports/print/rlpr/files/patch-ip-addr (new)
  1.4       +1 -0      ports/print/rlpr/pkg-descr
  1.2       +0 -4      ports/print/rlpr/pkg-plist (dead)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 Mikhail Teterin freebsd_committer freebsd_triage 2012-04-02 17:11:31 UTC
State Changed
From-To: feedback->closed

Committed, thanks!