bug-coreutils
[Top][All Lists]
Advanced

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

Re: test du/trailing-slash fails for coreutils-6.5 under Solaris 9


From: Jim Meyering
Subject: Re: test du/trailing-slash fails for coreutils-6.5 under Solaris 9
Date: Mon, 20 Nov 2006 16:54:43 +0100

Ralf Menzel <address@hidden> wrote:
> Jim Meyering <address@hidden> writes:
>> Please run these commands and send the resulting "full-log" file
>> to this list:
>>
>> (
>>   cd /home/menzel/src/3.4/coreutils-6.5/src
>>   ./rm -rf d slink && ./mkdir -p d/1/2 && ./ln -s d slink
>>   truss -o log ./du slink/
>>   cat log
>>   rm -f log
>> ) | tee full-log
>
> I've attached the log file.

Thank you.  This is the relevant part:

  fstatat64(-3041965, "slink/", 0x00036B38, 0x00001000) = 0
  ioctl(1, TCGETA, 0xFFBFC84C)                  Err#22 EINVAL
  fstat64(1, 0xFFBFC8C0)                                = 0
  brk(0x00037A50)                                       = 0
  brk(0x00039A50)                                       = 0
  fstat64(1, 0xFFBFC768)                                = 0
  write(1, " 1\t s l i n k /\n", 9)             = 9
  close(1)                                      = 0
  close(2)                                      = 0
  _exit(0)

It's not quite what I thought.
Solaris 9 has kernel-level openat support, which includes fstatat, but
that fstatat implementation has the same bug that afflicts their lstat
function: it doesn't honor a trailing slash on the name of a symlink
that specifies a directory.

The solution is to write an fstatat module for gnulib.  It will end
up being analogous to the existing lstat module.  The new module will
include a configure-time test (in m4/fstatat.m4) to detect the bug, and
then define FSTATAT_FOLLOWS_SLASHED_SYMLINK accordingly.  There will be
a replacement fstatat function in lib/fstatat.c, etc.

If no one else is interested in working on this, I'll get to it
eventually, but working around Solaris 9 bugs isn't a high priority for
me.  Think of this bug as incentive for you to upgrade to Solaris 10 :-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]