[Bug 1535] rename doesn't fall back to rename syscall upon ENOSYS of link syscall

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Wed Dec 10 10:07:38 EST 2008


https://bugzilla.mindrot.org/show_bug.cgi?id=1535





--- Comment #6 from Darren Tucker <dtucker at zip.com.au>  2008-12-10 10:07:37 ---
(In reply to comment #5)
> (In reply to comment #4)
> It was also brought to my attention on the mailinglist that the syscall
> link() shouldn't return ENOSYS. According to the link(2) the
> implementation of link in sshfs should return EPERM to indicate that
> creation of links is not supported. However the error check in
> sftp-server doesn't check EPERM either.

Actually it does (on Linux, anyway):

                if (link(oldpath, newpath) == -1) {
                        if (errno == EOPNOTSUPP
#ifdef EXDEV
                            || errno == EXDEV
#endif
#ifdef LINK_OPNOTSUPP_ERRNO
                            || errno == LINK_OPNOTSUPP_ERRNO
#endif
                            ) {


where on Linux, LINK_OPNOTSUPP_ERRNO is defined thusly:
        AC_DEFINE(LINK_OPNOTSUPP_ERRNO, EPERM,
                [Define to whatever link() returns for "not supported"
                if it doesn't return EOPNOTSUPP.])

-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.


More information about the openssh-bugs mailing list