rename(2) errno processing

Matt McCutchen matt at mattmccutchen.net
Sat Sep 25 10:38:17 MDT 2010


On Sat, 2010-09-25 at 09:09 -0700, Wayne Davison wrote:
> I believe that ENOTDIR should only be returned if some component in the path
> exists but is not a directory.  If the path is not fully there, it should
> instead return ENOENT.

POSIX is unclear about whether walking a path where a non-final
component is missing is allowed to return ENOTDIR.  IIUC, UWIN has taken
the interpretation that it is allowed, and does so.  See my other
message:

https://lists.samba.org/archive/rsync/2010-September/025606.html

> For 3.0.x, I don't want to treat ENOTDIR as a valid
> return because it is indicating a path failure that the 3.0.x code cannot
> handle (since it doesn't try to fix conflicting backup paths).  The 3.1.0
> code (in git) validates the backup paths to ensure that any conflicting bits
> turn into dirs (e.g. it will avoid an accidental use of a symlink as a dir
> in the path), and I'd imagine that this code should work fine in your
> environment.

Maybe so for the backup code, but I presume that the issue affects all
places where rsync checks for ENOENT from any syscall, not just
"rename".

-- 
Matt



More information about the rsync mailing list