Created attachment 1459 [details] fix rename One of the complaints we've commonly gotten from users is that modern versions of OpenSSH do not allow users to rename files in AFS across directories. Since OpenAFS only allows hardlinks in the parent directory, you can rename in the same directory but not across directory boundaries. This is the same behavior when you try to rename across regular partition boundaries, as a hardlink will fail with EXDEV. This patch fails over to doing a racy rename if EXDEV is returned.
Created attachment 1460 [details] fix rename if EXDEV is returned Helps if I make sure the patch is actually correct. Oops.
Greetings, I haven't heard anything regarding this patch. Is the patch okay? Is there something more that needs to be done?
Under what circumstances does rename(2) work across filesystems? According to the rename(2) man page on my fedora box: EXDEV oldpath and newpath are not on the same mounted filesystem. (Linux permits a filesystem to be mounted at multiple points, but rename(2) does not work across different mount points, even if the same filesystem is mounted on both.)
(In reply to comment #3) In OpenAFS, the ACL information is stored in the directory, which is why EXDEV is returned when you try to hardlink across directories. However, doing a rename works fine. Older versions (eg, 3.8) handled this fine, it was only when the if () blocks checking to see if errno was EOPNOTSUPP or LINK_OPNOTSUPP_ERRNO did this stop working.
Patch applied (with an #ifdef, since not all platforms have EXDEV) and will be in 5.1. Thanks.
Mass update RESOLVED->CLOSED after release of openssh-5.1