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: Eric Blake <eblake <at> redhat.com>
To: Joachim Schmitz <jojo <at> schmitz-digital.de>
Cc: 10305 <at> debbugs.gnu.org, eggert <at> cs.ucla.edu, bug-gnulib <at> gnu.org, 'Jim Meyering' <jim <at> meyering.net>
Subject: bug#10305: coreutils-8.14, "rm -r" fails with EBADF
Date: Fri, 16 Dec 2011 06:42:24 -0700
[Message part 1 (text/plain, inline)]
On 12/16/2011 06:02 AM, Joachim Schmitz wrote:
> Hmm, I can dup() an fd for a directory if or had been open()'d O_RDONLY, but
> not if opened O_WRONLY or O_RDWR, I'll get an EISDIR from open() then.

But you shouldn't be able to open() a directory O_WRONLY or O_RDWR in
the first place, under POSIX.  Is this a bug in our open() wrapper for
permitting a bad open() on a directory, which then renders the fd
un-dup()able?  Or is it really some other O_* flag causing the issue?

> 
>> I thought gnulib had pretty good dup* test coverage, but see that no dup*
> test
>> uses a directory file descriptor.

Good point, I will look into adding some.

> Any workaround?

We'll probably come up with something, once we can further characterize
what is going on, but I don't have one right now.

-- 
Eric Blake   eblake <at> redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

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.