On Mon, Feb 20, 2012 at 7:08 PM, walter harms <[email protected]> wrote:
> Am 20.02.2012 18:46, schrieb walter harms:
>> Am 19.02.2012 17:35, schrieb Denys Vlasenko:
>>> On Thursday 16 February 2012 17:21, walter harms wrote:
>>>> Hi,
>>>> i just found a minor but in lpr. (tested with 19.0)
>>>>
>>>>  touch null
>>>>  lpr null <- never returns
>>>
>>> Can't reproduce.
>>>
>>> Please strace it.
>>
>> Hello Denis,
>> can you reproduce it using  "lpr -Plp@remote null" ?
>>
>> from strace:
>> ...
>> read(3, "\0", 1)                        = 1
>> write(3, "\0", 1)                       = 1
>> read(3, 0x7ffff39a19b0, 1)              = ? ERESTARTSYS (To be restarted)   
>> <!-- last before SIGINT ->

It looks ok. We sent zero bytes if the file,
then sent NUL byte as end-of-file indicator,
and we wait for remote host to ACK or NAK it.

> When i add a file size check it seems to work.
>
> the problem is located here:
> static void get_response_or_say_and_die(int fd, const char *errmsg)
> {
>        ssize_t sz;
>        char buf[128];
>
>        buf[0] = ' ';
>        sz = safe_read(fd, buf, 1);  <-- never returns
>
> i do not know the lpr specs but i guess a file size of 0 is not permitted.

I didn't find any such restriction. Zero byte file is ok
(it does not make much sense, but is valid).

I think you lpd server is just buggy.
-- 
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to