Your message dated Wed, 13 Mar 2013 16:04:11 +0100
with message-id <[email protected]>
and subject line Re: file: "stdin: no read permission" if read from empty pipe
has caused the Debian Bug report #508963,
regarding file: "stdin: no read permission" if read from empty pipe
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
508963: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508963
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: file
Version: 4.26-2
Severity: normal

file normally does sensible things with an empty file, e.g.

$ touch empty; file empty
empty: empty
$ file - < empty
/dev/stdin: empty

but produces a confusing error message if you try to feed it an empty
file via a pipe:

$ cat empty | file
/dev/stdin: no read permission

I find this difference in strace logs suggestive:

-fstat(0, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
+fstat(0, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
 read(0, ""..., 98304)                   = 0
+access(NULL, W_OK)                      = -1 EFAULT (Bad address)
+access(NULL, X_OK)                      = -1 EFAULT (Bad address)
-write(1, "/dev/stdin: empty\n"..., 18)  = 18
+write(1, "/dev/stdin: no read permission\n"..., 31) = 31

I don't know what file is trying to do here (and I note that it is
almost always wrong to use access()), but perhaps it is assuming that a
failure of access() must be because of a lack of permissions, ignoring the
possibility of a bad pointer ...  I see it call access() with a sensible
pathname if I try to use it on /etc/shadow from an unprivileged account;
this also seems wrong -- it should take the EACCES result from the open()
as authoritative -- but that might give some clues where things are going
wrong in the code.

-- System Information:
Debian Release: 5.0
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages file depends on:
ii  libc6                  2.7-16            GNU C Library: Shared libraries
ii  libmagic1              4.26-2            File type determination library us
ii  zlib1g                 1:1.2.3.3.dfsg-12 compression library - runtime

file recommends no packages.

file suggests no packages.

-- no debconf information



--- End Message ---
--- Begin Message ---
file is not supposed to be used as '$whatever | file -' but as
'$whatever | file --files-from -'.

-- 
Address:        Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern
Email:          [email protected]
Internet:       http://people.progress-technologies.net/~daniel.baumann/

--- End Message ---

Reply via email to