bugGNU Core Utilities - Bugs: bug #21999, rm fails completely on systems...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #21999: rm fails completely on systems that don't have dirfd()

Submitted by:  None
Submitted on:  Thu 10 Jan 2008 04:04:31 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Wont Fix
Privacy: PublicAssigned to: None
Open/Closed: Closed

(Jump to the original submission Jump to the original submission)

Fri 25 Jan 2008 03:34:43 PM UTC, comment #6:

as discussed via email, Alan has opted to implement dirfd in his experimental C library, so I'm closing this. You're welcome to reopen if you need anything.

Jim Meyering <meyering>
Project Administrator
Thu 10 Jan 2008 11:57:46 PM UTC, comment #5:

Just checked other programs, and ls.c deals with dirfd() returning -1 and falls back to using an alternative.

It seems to me that remove.c doesn't check the return status of dirfd() ever failing and tries to do bad things...

For example, remove.c does this...

AD_push (dirfd (dirp), ds, dir, dir_st);

and then later it would try to fstat the file descriptor returned by dirfd() being -1 gets bogus results.

Anyway, not to worry. I'll fix libc and implement dirfd() instead.

Alan Hourihane <alanh>
Thu 10 Jan 2008 08:58:12 PM UTC, comment #4:

I guess if DIR_TO_FD() is -1 and dirfd() is not available, then configure should really abort.

The system I'm using is a little obscure, so it's not mainstream, so i guess I'll have to fix it's libc instead.

Alan Hourihane <alanh>
Thu 10 Jan 2008 07:01:54 PM UTC, comment #3:

Oh, I'm using coreutils-6.9 currently.

Alan Hourihane <alanh>
Thu 10 Jan 2008 07:01:27 PM UTC, comment #2:

In config.h I see this....

/* the name of the file descriptor member of DIR */
/* #undef DIR_FD_MEMBER_NAME */

#ifdef DIR_FD_MEMBER_NAME
# define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME)
#else
# define DIR_TO_FD(Dir_p) -1
#endif

And therefore dirfd() is implemented with returning DIR_TO_FD(Dir_p) -1.

Doing that and remove.c fails completely.

Alan Hourihane <alanh>
Thu 10 Jan 2008 05:45:54 PM UTC, comment #1:

There's a dirfd substitute for systems that lack it, so it shouldn't be a problem. Which version of coreutils are you using, exactly? And which system is failing? Can you please try the latest snapshot of coreutils, at <http://meyering.net/cu/>?

Paul Eggert <eggert>
Project Administrator
Thu 10 Jan 2008 04:04:31 PM UTC, original submission:

Due to the hard requirements in remove.c, rm completely fails to work on systems that don't implement dirfd().

Anonymous

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by meyering (Posted a comment)
  • -unavailable- added by alanh (Posted a comment)
  • -unavailable- added by eggert (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 25 Jan 2008 03:34:43 PM UTCmeyeringStatusNone=>Wont Fix
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1