> From [EMAIL PROTECTED] Thu Feb 21 15:03:30 2002
> Date: Fri, 22 Feb 2002 08:55:47 +1100
> To: [EMAIL PROTECTED]
> Subject: LPRng: When localhost != localhost
> From: [EMAIL PROTECTED] (Craig Small)
>
> Hello Patrick,
>   Minor bug but you may want to look into it one day.  It may point to
> something else not quite right security-wise.
>
> Change your /etc/hosts tosomething like you can see in
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=133048&repeatmerged=yes
>
> ie, 127.0.0.1 doesn't resolve to localhost and the permissions start to
> break down even with the unix socket.
>
> I admit it is a pretty wierd setup though.
>
> -- 
> Craig Small VK2XLZ  GnuPG:1C1B D893 1418 2AF4 45EE  95CB C76C E5AC 12CA DFA5
> Eye-Net Consulting http://www.eye-net.com.au/        <[EMAIL PROTECTED]>
> MIEEE <[EMAIL PROTECTED]>                 Debian developer <[EMAIL PROTECTED]>


>From the bug report:

**  I'm running an updated woody installation (last update 09-feb-2002)
**  with kernel 2.2.19.
**  
**  /etc/printcap:
**  
**  lp|hp1150c|HP OfficeJet Pro 1150C:\
**          :lp=/dev/lp0:sd=/var/spool/lpd/hp1150c:\
**          :sh:pw#80:pl#60:px#1440:mx#0:\
**          :if=/etc/magicfilter/oj1150c-filter:\
**          :af=/var/log/lp-acct:lf=/var/log/lp-errs:
**  
**  
**  /etc/hosts:
**  
**  127.0.0.0       loopback

          ^^^^^ why is he doing this?
**  192.168.1.6     wall.vd-stelt.nl        wall localhost
                                                 ^^^^^ why is he doing this?

This is nuts,  he will break all sorts of other things.

OK, here is the patch for this... NOTE: if he does not have a
localhost entry, or the DNS server screws up and returns a wrong
localhost value,  then all bets are off. Right?


*** common/lpd_dispatch.c       2002/02/22 18:30:17     1.7
--- common/lpd_dispatch.c       2002/02/23 00:21:40
***************
*** 206,214 ****
  #endif
                ){
                /* force the localhost address */
                memset( &sinaddr, 0, sizeof(sinaddr) );
!               sinaddr.sa_family = AF_INET;
!               inet_pton( sinaddr.sa_family, "127.0.0.1", &((struct sockaddr_in 
*)(&sinaddr))->sin_addr );
        } else {
                FATAL(LOG_INFO) _("Service_connection: bad protocol family '%d'"), 
sinaddr.sa_family );
        }
--- 206,228 ----
  #endif
                ){
                /* force the localhost address */
+               int len;
+               void *s, *addr;
                memset( &sinaddr, 0, sizeof(sinaddr) );
!               sinaddr.sa_family = Localhost_IP.h_addrtype;
!               len = Localhost_IP.h_length;
!               if( sinaddr.sa_family == AF_INET ){
!                       addr = &(((struct sockaddr_in *)&sinaddr)->sin_addr);
! #if defined(IPV6)
!               } else if( sinaddr->sa_family == AF_INET6 ){
!                       addr = &(((struct sockaddr_in6 *)&sinaddr)->sin6_addr);
! #endif
!               } else {
!                       FATAL(LOG_INFO) _("Service_connection: BAD LocalHost_IP 
value"));
!                       addr = 0;
!               }
!               s = Localhost_IP.h_addr_list.list[0];
!               memmove(addr,s,len);
        } else {
                FATAL(LOG_INFO) _("Service_connection: bad protocol family '%d'"), 
sinaddr.sa_family );
        }

-----------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------

Reply via email to