This is the mail archive of the cygwin-patches mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: rmdir: improvement for emptiness check

Hi Simon,

On Aug  6 15:57, Simon wrote:
> Dear list,
> when deleting a directory, cygwin checks if the directory is empty.
> When doing so, it skipped every second file found in that directory
> (note the repetition of the line "pfni = ...NextEntryOffset"). This is
> a problem when, e.g., there are two files in that directory and the
> first one is in a PENDING_DELETE state. The second one will not be
> tested, so the directory is considered empty.
> This is not an urgent patch, but fixing this should lower the
> probability of an accidentally, temporarily "deleted" directory (i.e.
> 1. think it is empty; 2. move to recycle bin; 3. check again; 4.
> notice the error and move back to its old location).

Good catch!  Can you create a `git format-patch' style patch
with a nice log message, please?

> NB.: The whole move-to-bin strategy is broken and maybe even
> unfounded. I don't know why cygwin is trying to move an empty
> directory to a recycle.bin folder. The inherent race condition seems
> avoidable to me. Is there a discussion regarding that behaviour?

  $ mkdir dir
  $ cd dir
  $ rmdir ../dir


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: signature.asc
Description: PGP signature

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]