GNU bug report logs - #8154
du: issue with `--files0-from=DIR'

Previous Next

Package: coreutils;

Reported by: Stefan Vargyas <stvar <at> yahoo.com>

Date: Wed, 2 Mar 2011 14:23:01 UTC

Severity: normal

Fixed in version 8.11

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #29 received at 8154 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 8154 <at> debbugs.gnu.org, bug-gnulib <bug-gnulib <at> gnu.org>,
	Stefan Vargyas <stvar <at> yahoo.com>, Eric Blake <eblake <at> redhat.com>
Subject: Re: bug#8154: du: issue with `--files0-from=DIR'
Date: Wed, 02 Mar 2011 18:25:13 +0100
Paul Eggert wrote:
> On 03/02/2011 07:09 AM, Jim Meyering wrote:
>> -  struct argv_iterator *ai = malloc (sizeof *ai);
>> +  struct argv_iterator *ai;
>> +  struct stat st;
>> +
>> +  if (fstat (fileno (fp),&st) == 0&&  S_ISDIR (st.st_mode))
>> +    {
>> +      errno = EISDIR;
>> +      return NULL;
>> +    }
>> +
>> +  ai = malloc (sizeof *ai);
>
> My kneejerk reaction is that this part of the patch
> should not be needed (though other fixes obviously are).
> There are lots of reasons that the stream could fail:
> why check for directories specially?  Just let the
> stream fail in the way that it normally would; this
> keeps the code smaller and simpler.  On an ancient
> host where "cat dir/" works, "du --files0-from=dir/"
> should not arbitrarily fail.

I think you're right.  The added complexity (both here
and in each client) is not worth the theoretical gain
in error-handling uniformity.

If new tests induce false-positive failure due
to differences in how reading from a directory works
under the covers, we can deal with it in the tests.

Thanks!




This bug report was last modified 14 years and 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.