From owner-freebsd-bugs Thu Feb 4 10:20:07 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA27514 for freebsd-bugs-outgoing; Thu, 4 Feb 1999 10:20:07 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA27465 for ; Thu, 4 Feb 1999 10:20:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id KAA93093; Thu, 4 Feb 1999 10:20:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Date: Thu, 4 Feb 1999 10:20:01 -0800 (PST) Message-Id: <199902041820.KAA93093@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.ORG From: David Malone Subject: Re: bin/7081: [patch] lpr stuff doesn't deal with RM and RP well if RM = hostname Reply-To: David Malone Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/7081; it has been noted by GNATS. From: David Malone 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