diff options
author | Darren Tucker <dtucker@zip.com.au> | 2004-06-28 16:01:19 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2004-06-28 16:01:19 +1000 |
commit | e59b50879819db3bbb189ba7e069950a8991ea05 (patch) | |
tree | 0c771262fb0f74ef43283c26c71ec8fdb0c5ee3d /sftp-server.c | |
parent | f9eb2b013510ef35372560e673d0bf80b1b4dd2c (diff) |
- (dtucker) [acconfig.h configure.ac sftp-server.c] Bug #823: add sftp
rename handling for Linux which returns EPERM for link() on (at least some)
filesystems that do not support hard links. sftp-server will fall back to
stat+rename() in such cases.
Diffstat (limited to 'sftp-server.c')
-rw-r--r-- | sftp-server.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sftp-server.c b/sftp-server.c index 39a6bdab4..1ff4750ea 100644 --- a/sftp-server.c +++ b/sftp-server.c | |||
@@ -840,7 +840,11 @@ process_rename(void) | |||
840 | else if (S_ISREG(sb.st_mode)) { | 840 | else if (S_ISREG(sb.st_mode)) { |
841 | /* Race-free rename of regular files */ | 841 | /* Race-free rename of regular files */ |
842 | if (link(oldpath, newpath) == -1) { | 842 | if (link(oldpath, newpath) == -1) { |
843 | if (errno == EOPNOTSUPP) { | 843 | if (errno == EOPNOTSUPP |
844 | #ifdef LINK_OPNOTSUPP_ERRNO | ||
845 | || errno == LINK_OPNOTSUPP_ERRNO | ||
846 | #endif | ||
847 | ) { | ||
844 | struct stat st; | 848 | struct stat st; |
845 | 849 | ||
846 | /* | 850 | /* |