GNU bug report logs - #10305
coreutils-8.14, "rm -r" fails with EBADF

Previous Next

Package: coreutils;

Reported by: "Joachim Schmitz" <jojo <at> schmitz-digital.de>

Date: Thu, 15 Dec 2011 14:08:01 UTC

Severity: wishlist

Tags: notabug

Full log


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

From: "Joachim Schmitz" <jojo <at> schmitz-digital.de>
To: "'Eric Blake'" <eblake <at> redhat.com>,
	"'Jim Meyering'" <jim <at> meyering.net>
Cc: 10305 <at> debbugs.gnu.org, 'Paul Eggert' <eggert <at> cs.ucla.edu>,
	bug-gnulib <at> gnu.org
Subject: RE: bug#10305: coreutils-8.14, "rm -r" fails with EBADF
Date: Wed, 21 Dec 2011 18:38:39 +0100
> From: Joachim Schmitz [mailto:jojo <at> schmitz-digital.de]
> Sent: Wednesday, December 21, 2011 6:12 PM
> To: 'Eric Blake'; 'Jim Meyering'
> Cc: '10305 <at> debbugs.gnu.org'; 'Paul Eggert'; 'bug-gnulib <at> gnu.org'
> Subject: RE: bug#10305: coreutils-8.14, "rm -r" fails with EBADF
> 
> > From: Eric Blake [mailto:eblake <at> redhat.com]
> > Sent: Wednesday, December 21, 2011 5:28 PM
> > To: Jim Meyering
> > Cc: Joachim Schmitz; 10305 <at> debbugs.gnu.org; 'Paul Eggert'; bug-
> > gnulib <at> gnu.org
> > Subject: Re: bug#10305: coreutils-8.14, "rm -r" fails with EBADF
> >
> > On 12/21/2011 09:06 AM, Jim Meyering wrote:
> > >>
> > >> Where to go now?
> > >>
> > >> Resorting to wild guesses, I tried all 3 members of struct DIR as
> > >> DIF_FD_MEMBER_NAME, no change to the EBADF
> > >
> > > Write a small test program that opens say four directories, to get
> > > one
> > > DIR* pointer for each.  Then print a table of the DIR member values.
> > > Maybe you'll see a pattern, i.e., how to derive an FD number from
> > > those dd1,2,3 fields.
> 
> Yes, indeed, thanks for that idea (should have been mine):
> It got to be dd1, only it is not an fd but something called fnum and these a) start
> counting with 1 rather than 0 and b) have 1 and 2 being root and CPD, followed

CWD I meant

> by 3,4 and 5 being stdin, stdout, stderr... it seems fnum -3 == fd
<snip>
> 
> So let's see whether taking that fnum (AKA "dd1") and subtracting 3 makes it a
> proper fd.
> But this is something for tomorrow...

Apparently an over simplistic approach: doesn't work, I still get an EBADF.

I tried in config.h:

#ifdef DIR_FD_MEMBER_NAME
# define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME) 
#elif defined __TANDEM
# define DIR_TO_FD(Dir_p) (((Dir_p)->dd1) - 3)
#else 
# define DIR_TO_FD(Dir_p) -1 
#endif

Didn't work, unfortunately...





This bug report was last modified 12 years and 110 days ago.

Previous Next


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