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()

Submitter:  None
Submitted:  Thu 10 Jan 2008 04:04:31 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Wont Fix
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

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>
Group 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>
Group 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

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-01-25 meyering StatusNone Wont Fix
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code