Hi Chis. Well, I am back from the Dark Side of the Moon and have been looking at a slew of patches that Darin ([EMAIL PROTECTED]) has handed me.
(Note to list readers: if you MUST get hold of me ASAP, then call Darin (858-874-6543) or send him email ([EMAIL PROTECTED]) with LPRNG PROBLEM in the subject line. I am currently a bit email impaired. I plan to devote the next couple of weeks putting in all of the patches, changes, etc., that people have posted. I have looked at this one fairly carefully. There is a subtle problem with using this type of thing on a host with multiple Network Interfaces. I have discovered that the network address chosen for origination depends on OS, OS Version, Phase of Moon, and Whim of Implementor. (This was about 3 years ago, and I think the situation has not changed much.) So I might need to add some language about this. There is also the issue of a forwarded job. If the job is forwarded from a server, then you do NOT want to change the origination address. So, you need to do something like: parm=!ip.addr.server,other.ip.address I suggest that you use , to separate the IP address values, and do not use spaces. Patrick > From [EMAIL PROTECTED] Thu Jun 19 11:51:48 2003 > Date: Thu, 19 Jun 2003 20:51:20 +0200 (MEST) > From: Christoph Beyer <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Subject: LPRng: Re: Rewrite the control file hostname with real requesting > hostname (fwd) > > > > best regards > ~christoph > > > -- > /* Christoph Beyer | Office: Building 2b / 23 *\ > * DESY | Phone: 040-8998-2317 * > * - IT - | Fax: 040-8998-4060 * > \* 22603 Hamburg | http://www.desy.de */ > > > ---------- Forwarded message ---------- > Date: Thu, 19 Jun 2003 13:27:54 +0200 (CEST) > From: Henrik Edlund <[EMAIL PROTECTED]> > Reply-To: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > Subject: LPRng: Re: Rewrite the control file hostname with real requesting > hostname > > And yet another fix to this patch, fixing Value_sep to File_sep in one > place. Hopefully this will be the last post about this, as I am rewriting > this patch to put a trusted username in the R record (accounting info) in > the control file instead, and leaving the P record (username) to be > whatever the user sets and hence untrusted. > > --- LPRng-3.8.21/src/common/getqueue.c.orig Wed Apr 16 01:37:42 2003 > +++ LPRng-3.8.21/src/common/getqueue.c Thu Jun 19 13:23:11 2003 > @@ -2104,11 +2104,53 @@ > int status = 0, fd, i; > struct stat statb; > > + struct line_list l, listv; > + char *s, *t; > + Init_line_list(&l); > + Init_line_list(&listv); > + > if(DEBUGL3) Dump_job( "Create_control: before fixing", job ); > > /* deal with authentication */ > > Make_identifier( job ); > + > + /* > + * if we get a request from these hosts, change host name in control > + * file (possibly faked if from untrusted host) to FQDN of remote host > + */ > + if( Force_controlfile_originate_hostname_DYN ){ > + Free_line_list(&l); > + > Split(&l,Force_controlfile_originate_hostname_DYN,File_sep,0,0,0,0,0,0); > + if( Match_ipaddr_value( &l, &RemoteHost_IP ) == 0 ){ > + DEBUG1("Create_control: remotehost '%s'", FQDNRemote_FQDN ); > + Set_str_value(&job->info,FROMHOST,FQDNRemote_FQDN); > + fromhost = Find_str_value(&job->info,FROMHOST,Value_sep); > + } > + Free_line_list(&l); > + } > + > + /* > + * if we get a request from these hosts, change user name in control > + * file (possibly faked if from untrusted host) to specified > + */ > + if( Force_controlfile_username_DYN ){ > + Free_line_list(&listv); > + Split(&listv,Force_controlfile_username_DYN,";",0,0,0,0,0,0); > + for(i = 0; i < listv.count; ++i ){ > + s = listv.list[i]; > + if( (t = safestrpbrk(s,Value_sep)) ) *t++ = 0; > + Free_line_list(&l); > + Split(&l,t,File_sep,0,0,0,0,0,0); > + if( Match_ipaddr_value( &l, &RemoteHost_IP ) == 0 ){ > + DEBUG1("Create_control: username '%s'", s ); > + Set_str_value(&job->info,LOGNAME,s); > + break; > + } > + } > + Free_line_list(&l); > + Free_line_list(&listv); > + } > > if( !(fromhost = Find_str_value(&job->info,FROMHOST,Value_sep)) || > Is_clean_name(fromhost) ){ > Set_str_value(&job->info,FROMHOST,FQDNRemote_FQDN); > > ----------------------------------------------------------------------------- > YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST > The address you post from MUST be your subscription address > > If you need help, send email to [EMAIL PROTECTED] (or lprng-requests > or lprng-digest-requests) with the word 'help' in the body. For the impatient, > to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED] > with: | example: > subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED] > unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED] > > If you have major problems, send email to [EMAIL PROTECTED] with the word > LPRNGLIST in the SUBJECT line. > ----------------------------------------------------------------------------- > > ----------------------------------------------------------------------------- YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST The address you post from MUST be your subscription address If you need help, send email to [EMAIL PROTECTED] (or lprng-requests or lprng-digest-requests) with the word 'help' in the body. For the impatient, to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED] with: | example: subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED] unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED] If you have major problems, send email to [EMAIL PROTECTED] with the word LPRNGLIST in the SUBJECT line. -----------------------------------------------------------------------------
