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


View this message in rfc822 format

From: "Joachim Schmitz" <jojo <at> schmitz-digital.de>
To: "'Paul Eggert'" <eggert <at> cs.ucla.edu>
Cc: 10305 <at> debbugs.gnu.org, bug-gnulib <at> gnu.org, 'Eric Blake' <eblake <at> redhat.com>, 'Jim Meyering' <jim <at> meyering.net>
Subject: bug#10305: coreutils-8.14, "rm -r" fails with EBADF
Date: Fri, 16 Dec 2011 22:21:58 +0100
> From: Paul Eggert [mailto:eggert <at> cs.ucla.edu]
> Sent: Friday, December 16, 2011 7:47 PM
> To: Joachim Schmitz
> Cc: 'Eric Blake'; 'Jim Meyering'; 10305 <at> debbugs.gnu.org; bug-gnulib <at> gnu.org
> Subject: Re: bug#10305: coreutils-8.14, "rm -r" fails with EBADF
> 
> On 12/16/11 05:46, Joachim Schmitz wrote:
> > It is not O_NOCTTY or O_NONBLOCK and the others (O_SEARCH,
> > O_DIRECTORY, O_NOFOLLOW, O_NOATIME) don't exist here.
> 
> It could be the FD_CLOEXEC, perhaps.  What does the following do?
> Try it standalone, and also try it compiled and linked against gnulib.
> 
> 
> #include <fcntl.h>
> #include <unistd.h>
> #include <stdio.h>
> 
> int main (void)
> {
>   int fd, r, fd2;
>   fd = open (".", O_RDONLY | O_NOCTTY | O_NONBLOCK);
>   if (fd < 0)
>     return perror ("open"), 1;
>   r = fcntl (fd, F_SETFD, FD_CLOEXEC);
>   if (r < 0)
>     return perror ("F_SETFD"), 1;
>   fd2 = dup (fd);
>   if (fd2 < 0)
>     return perror ("dup"), 1;
>   return 0;
> }

The standalone version works just fine.





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.