[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#192356: pcmcia-cs: Removing pcmcia-cs confuses mandb, resulting in error messages



On Fri, 9 May 2003, Colin Watson wrote:

[Classic case of timewarp!  This reached me today.]

> On Fri, May 09, 2003 at 12:37:42PM -0400, Dave Rutherford wrote:
> > dpkg: serious warning: files list file for package `realplayer' missing, assuming package has no files currently installed.
> > dpkg: serious warning: files list file for package `xv-doc' missing, assuming package has no files currently installed.
> > dpkg: serious warning: files list file for package `xv' missing, assuming package has no files currently installed.
> > dpkg: serious warning: files list file for package `acroread' missing, assuming package has no files currently installed.
> > dpkg: serious warning: files list file for package `bladeenc' missing, assuming package has no files currently installed.
>
> That looks as if there's been some corruption in the past, although
> that's not necessarily relevant.

I once lost a lot of files under /var.  I've since reinstalled the
above packages, clearing up the warnings.

> > bash-2.05b# cd /usr/share/man/man4
> > bash-2.05b# ls -l wvlan_cs.4 ray_cs.4 airo.4 airo_cs.4
> > -rw-r-----    1 root     root         6074 Dec 19  2001 airo.4
> > -rw-r-----    1 root     root          699 Dec 19  2001 airo_cs.4
> > -rw-r-----    1 root     root         3411 Dec 19  2001 ray_cs.4
> > -rw-r-----    1 root     root         7715 Dec 19  2001 wvlan_cs.4
> > bash-2.05b#
> >
> > So they exist (pcmcia-cs installed or not,) aren't symlinks of
> > any sort, have the same odd permissions (nothing else in this
> > directory is 640, but 644,) and only cause mandb to complain
> > when pcmcia-cs isn't installed.  I haven't found any symlinks
> > that point to them (or try to.)
>
> What are the contents of those files? I suspect that they may include
> ".so" at the start of a line in some places; that's groff's "source"
> request.

No ".so" requests.  I'll send you one of them if you like, but
it now looks like this is a permissions thing.  (but WHY it should
come and go with pcmcia-cs, when the permissions and the contents
don't change, is still a mystery.)

> Failing that, the output of 'mandb --debug' run as user man would be
> interesting. There may be a lot of it.
>
> > Changing their permissions to 644 also shuts up mandb, though
> > I don't see why, as their 640 permissions are the same whether
> > pcmcia-cs is installed or not.  And mandb is running as root, anyway.
>
> Actually, if you look at /etc/cron.weekly/man-db you'll probably find
> that it drops privileges to the man user. The error is "No such file or
> directory" rather than "Permission denied", though, which is odd ...

I understand this part now.  I ran as user man:

sh-2.05b$ strace -o mandb.strace mandb --debug >mandb.output 2>&1

There is indeed a lot of output.  Here's a sample.

    ult_src: File /usr/share/man/man4/wvlan_cs.4 in mantree /usr/share/man
    mandb: can't open /usr/share/man/man4/wvlan_cs.4: No such file or directory
    mandb: warning: /usr/share/man/man4/wvlan_cs.4: bad symlink or ROFF `.so' request

That doesn't tell me anything new.  But here's the same part
from the strace output:

    lstat64("/usr/share/man/man4/wvlan_cs.4", {st_mode=S_IFREG|0640, st_size=7715, ...}) = 0
    pread(4, "\0\0\0\0\0\0\0\0\211\0\0\0?\0\0\0\30\0\0\0006\0,\7\1\5"..., 4096, 561152) = 4096
    write(2, "\nult_src: File /usr/share/man/ma"..., 72) = 72
    open("/usr/share/man/man4/wvlan_cs.4", O_RDONLY) = -1 EACCES (Permission denied)
    stat64("/usr/share/man/man4/wvlan_cs.4.gz", 0xbfffe770) = -1 ENOENT (No such file or directory)
    stat64("/usr/share/man/man4/wvlan_cs.4.z", 0xbfffe770) = -1 ENOENT (No such file or directory)
    stat64("/usr/share/man/man4/wvlan_cs.4.Z", 0xbfffe770) = -1 ENOENT (No such file or directory)
    stat64("/usr/share/man/man4/wvlan_cs.4.bz2", 0xbfffe770) = -1 ENOENT (No such file or directory)
    write(2, "mandb: ", 7)                  = 7
    write(2, "can\'t open /usr/share/man/man4/w"..., 41) = 41
write(2, ": No such file or directory", 27) = 27
    write(2, "mandb: ", 7)                  = 7
    write(2, "warning: /usr/share/man/man4/wvl"..., 74) = 74
    write(2, "\n", 1)                       = 1

So mandb is being, shall we say creative, in trying to find the
file, but in so doing, it overwrites the relevant value of errno,
and winds up making a misleading report.

So let's rerun the test with pcmcia-cs installed.  It starts the same,
gets the same EACCESS, but then for some reason proceeds OK.

    lstat64("/usr/share/man/man4/wvlan_cs.4.gz", {st_mode=S_IFREG|0644, st_size=3312, ...}) = 0
    pread(4, "\0\0\0\0\0\0\0\0\211\0\0\0?\0\0\0\30\0\0\0006\0,\7\1\5"..., 4096, 561152) = 4096
    write(2, "\nult_src: File /usr/share/man/ma"..., 75) = 75
    open("/usr/share/man/man4/wvlan_cs.4", O_RDONLY) = -1 EACCES (Permission denied)
    stat64("/usr/share/man/man4/wvlan_cs.4.gz", {st_mode=S_IFREG|0644, st_size=3312, ...}) = 0

Aha!  There's a file wvlan_cs.4.gz present when pcmcia_cs is installed,
which has world-readable permissions.  Same for the other three.  That's
why mandb works in this case.

I have no memory of ever manually decompressing these man pages,
or even of looking at them.  Maybe the troublesome files got left there
from some unstable upgrade of pcmcia-cs.  They would seem to be
connected with the package.

Best regards,
   Dave




Reply to: