Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Feb 1999 10:20:01 -0800 (PST)
From:      David Malone <dwmalone@maths.tcd.ie>
To:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: bin/7081: [patch] lpr stuff doesn't deal with RM and RP well if RM = hostname
Message-ID:  <199902041820.KAA93093@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/7081; it has been noted by GNATS.

From: David Malone <dwmalone@maths.tcd.ie>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: bin/7081: [patch] lpr stuff doesn't deal with RM and RP well if RM = hostname
Date: Thu, 04 Feb 1999 18:15:04 +0000

 This PR has been fixed in 2.2-STABLE (as of version 1.4.2.3 of common.c).
 Lpr is quite different in 3.0 so the same patch won't work. However I've
 written what I think is an equivelent patch for 3.0 and current - it should
 have the same effect as the 2.2 fix. If this was committed the PR could
 be closed.
 
 	David.
 
 
 diff -cwr common_source/lp.h /usr/src/usr.sbin/lpr/common_source/lp.h
 *** common_source/lp.h	Thu Feb  4 17:04:06 1999
 --- /usr/src/usr.sbin/lpr/common_source/lp.h	Tue Dec  2 20:45:21 1997
 ***************
 *** 50,56 ****
   struct	printer {
   	char	*printer;	/* printer name */
   	int	 remote;	/* true if RM points to a remote host */
 - 	int	 rp_matches_local; /* true if rp has same name as us */
   	int	 tof;		/* true if we are at top-of-form */
   	/* ------------------------------------------------------ */
   	char	*acct_file;	/* AF: accounting file */
 --- 50,55 ----
 diff -cwr common_source/net.c /usr/src/usr.sbin/lpr/common_source/net.c
 *** common_source/net.c	Thu Feb  4 17:19:21 1999
 --- /usr/src/usr.sbin/lpr/common_source/net.c	Tue Dec  2 20:45:22 1997
 ***************
 *** 160,170 ****
   	struct in_addr *localaddrs;
   	int i, j, nlocaladdrs, ncommonaddrs;
   
 - 	if (!pp->rp_matches_local) { /* Remote printer doesn't match local */
 - 		pp->remote = 1;
 - 		return NULL;
 - 	}
 - 
   	pp->remote = 0;	/* assume printer is local */
   	if (pp->remote_host != NULL) {
   		/* get the addresses of the local host */
 --- 160,165 ----
 diff -cwr common_source/printcap.c /usr/src/usr.sbin/lpr/common_source/printcap.c
 *** common_source/printcap.c	Thu Feb  4 17:57:21 1999
 --- /usr/src/usr.sbin/lpr/common_source/printcap.c	Sat Dec 27 20:49:39 1997
 ***************
 *** 215,222 ****
   	struct printer *pp;
   {
   	enum lpd_filters filt;
 - 	char *rp_name;
 - 	int error;
   
   	if ((pp->printer = capdb_canonical_name(bp)) == 0)
   		return PCAPERR_OSERR;
 --- 215,220 ----
 ***************
 *** 264,283 ****
   	pp->rw = capdb_getaltlog(bp, "rw", "tty.rw");
   	pp->tof = !capdb_getaltlog(bp, "fo", "job.topofform");
   	
 - 	/*
 - 	 * Decide if the remote printer name matches the local printer name.
 - 	 * If no name is given then we assume they mean them to match.
 - 	 * If a name is given see if the rp_name is one of the names for
 - 	 * this printer.
 - 	 */
 - 	pp->rp_matches_local = 1;
 - 	CHK((error = capdb_getaltstr(bp, "rp", "remote.queue", 0, &rp_name)));
 - 	if (error != PCAPERR_NOTFOUND && rp_name != NULL) {
 - 		if (cgetmatch(bp,rp_name) != 0)
 - 			pp->rp_matches_local = 0;
 - 		free(rp_name);
 - 	}
 - 
   	/*
   	 * Filters:
   	 */
 --- 262,267 ----

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902041820.KAA93093>