On Tue, 24 Sep 2002, John Perkins wrote:

> Your followup truss/strace output makes me think you're dealing with a
> unix socket issue.  In particular, this so_socket call fails:
>
>       27890:  so_socket(1, 2, 0, "", 1)                       = 3
>
> where this one works (with lpr -Plp@host):
>
>       27903:  so_socket(2, 2, 0, "", 1)                       = 3
>
> It just happens that socket type PF_UNIX is defined as "1" (for Linux
> anyway), where PF_INET (TCP socket) is defined as "2", and that happens
> to be the first argument to the socket() function call...

I did not mention that I use tcp-wrappers. When people complain
about loosing jobs here, I had a look when I run lpd from 3.8.15 and
use old lpr client to print a file (withouth stating -Plp@host):

1209:   poll(0xEFFFD410, 3, 573000)                     = 1
1209:   sigaction(SIGCLD, 0xEFFFF2E0, 0xEFFFF360)       = 0
1209:   accept(8, 0xEFFFF7E0, 0xEFFFF474)               = 11
1209:   getpid()                                        = 1209 [1]
1209:   getpeername(11, 0x0002A9B0, 0xEFFFEFFC)         = 0
1209:   getsockname(11, 0x0002A9C0, 0xEFFFEFFC)         = 0
1209:   fstat(12, 0xEFFFF388)                           = 0
1209:   open("/etc/hosts.allow", O_RDONLY)              = 13
1209:   fstat64(13, 0xEFFFE950)                         = 0
1209:   ioctl(13, TCGETA, 0xEFFFE8DC)                   Err#25 ENOTTY
1209:   read(13, " A L L :   1 2 7 . 0 . 0".., 8192)    = 1366
1209:   llseek(13, 0xFFFFFFFFFFFFFFFF, SEEK_CUR)        = 1365
1209:   close(13)                                       = 0
1209:   so_socket(2, 2, 0, "", 1)                       = 13
1209:   sigaction(SIGALRM, 0xEFFFE108, 0xEFFFE188)      = 0
1209:   alarm(10)                                       = 0
1209:   bind(13, 0xEFFFE538, 16)                        Err#126 EADDRNOTAVAIL
1209:   alarm(0)                                        = 10
1209:   close(13)                                       = 0
1209:   open64("/etc/.name_service_door", O_RDONLY)     = 13
1209:   fcntl(13, F_SETFD, 0x00000001)                  = 0
1209:   door_info(13, 0xEF62BCF8)                       Err#9 EBADF
1209:   close(13)                                       = 0
1209:   open("/etc/hosts", O_RDONLY)                    = 13
1209:   fstat64(13, 0xEFFFBF88)                         = 0
1209:   ioctl(13, TCGETA, 0xEFFFBF14)                   Err#25 ENOTTY
1209:   read(13, " #\n #   I n t e r n e t".., 8192)    = 143
1209:   read(13, 0x00033914, 8192)                      = 0
1209:   llseek(13, 0, SEEK_CUR)                         = 143
1209:   close(13)                                       = 0
1209:   stat("/etc/resolv.conf", 0xEFFFB8B8)            = 0
1209:   so_socket(2, 1, 0, "", 1)                       = 13
1209:   connect(13, 0xEF4717C4, 16)                     = 0
1209:   send(13, "F5A501\0\001\0\0\0\0\0\0".., 44, 0)   = 44
1209:   poll(0xEFFFB7B4, 1, 5000)                       = 1
1209:   fcntl(13, F_GETFL, 0x00000000)                  = 2
1209:   fstat64(13, 0xEFFFB5B0)                         = 0
1209:   getsockopt(13, 65535, 8192, 0xEFFFB6B4, 0xEFFFB6AC) = 0
1209:   fstat64(13, 0xEFFFB5B0)                         = 0
1209:   getsockopt(13, 65535, 8192, 0xEFFFB6B4, 0xEFFFB6B0) = 0
1209:   setsockopt(13, 65535, 8192, 0xEFFFB6B4, 4)      = 0
1209:   fcntl(13, F_SETFL, 0x00000006)                  = 0
1209:   recvfrom(13, "F5A58183\001\0\0\001\0\0".., 65536, 0, 0xEFFFB7A0, 0xEFFFB7B0) = 
108
1209:   fstat64(13, 0xEFFFB5B0)                         = 0
1209:   getsockopt(13, 65535, 8192, 0xEFFFB6B4, 0xEFFFB6B0) = 0
1209:   setsockopt(13, 65535, 8192, 0xEFFFB6B4, 4)      = 0
1209:   fcntl(13, F_SETFL, 0x00000002)                  = 0
1209:   close(13)                                       = 0
1209:   fork()                                          = 1510
1510:   fork()          (returning as child ...)        = 1209
1510:   sigaction(SIGHUP, 0xEFFFE4A8, 0xEFFFE528)       = 0
1510:   close(0)                                        = 0
1510:   close(1)                                        = 0
1510:   close(2)                                        = 0
1510:   open("/dev/null", O_RDWR)                       = 0
1510:   dup(0)                                          = 1
1510:   dup(0)                                          = 2
1510:   execve("/bin/sh", 0xEFFFE550, 0x0002ADE8)  argc = 3
1510:       *** SUID: ruid/euid/suid = 0 / 1 / 1  ***
1510:    argv: sh -c
1510:     (/usr/sbin/safe_finger -l @0.0.0.0 @0.0.0.0 @0.0.0.0 | /usr/bin/Mail -s 
[EMAIL PROTECTED] 
[EMAIL PROTECTED])


using lpq from 3.8.15 gives me just one line of output, while the old lpq binary works:

pf-i400$ /software/@sys/usr/bin/lpq -a
Printer: lp is [EMAIL PROTECTED]
pf-i400$ /usr/local/bin/lpq -a
Printer: lp is [EMAIL PROTECTED]
Printer: lp-pf-i400@pf-i400 'lp-pf-i400-R'
 Queue: 1 printable job
 Server: pid 1396 active
 Unspooler: pid 1397 active
 Status: waiting for subserver to exit at 21:42:48.720
 Rank   Owner/ID                  Class Job Files                 Size Time
stalled(257sec) root@pf-i400+395    A   395 /etc/motd              823 21:38:36
done   ivatis@pf-i400+779           A   779 /vnmr/tmp/pf-i400PL 260286 09:47:21
Printer: lp-var400 is lp@var400
Printer: lp@var400  'lp-var400-R'
 Queue: no printable jobs in queue
 Status: job 'rohov@pf-i400+288' removed at 17:33:31.989
Printer: smb-pczadr is |/software/@sys/usr/share/filters/smbprint
Printer '|/software/@sys/usr/share/filters/smbprint' - cannot open connection - bad or 
missing hostname
Printer: lp-pczadr is [EMAIL PROTECTED]
Printer '[EMAIL PROTECTED]' - cannot open connection - Connection timed out
Make sure LPD server is running on the server
Printer: PS_A@pf-i400 'PS_AR'
 Queue: no printable jobs in queue
pf-i400$

Old lpq works excpet the fact it's not happy with:

smb-pczadr:\
        :lp=|/software/@sys/usr/share/filters/smbprint:\
        :sd=/var/spool/lpd/smb-pczadr:\
        :lf=/var/spool/lpd/smb-pczadr/log:\
        :ps=/var/spool/lpd/smb-pczadr/status:\
        :if=/software/@sys/usr/share/filters/ljet4m:\
        :mx#0:ml=0:check_for_nonprintable@:send_data_first true:

So, stating in /etc/hosts.allow::

ALL: 0.0.0.0: allow

makes my lpq and lpr work. Does it mean that the connection via sockets doesn't
have an IP number, right? But why does lpd try to get the client's IP number???






-- 
Martin Mokrejs <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
PGP5.0i key is at http://www.natur.cuni.cz/~mmokrejs
MIPS / Institute for Bioinformatics <http://mips.gsf.de>
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse 1, D-85764 Neuherberg, Germany
tel.: +49-89-3187 3683 , fax: +49-89-3187 3585


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