Skip to content

Commit

Permalink
Map SSH2_FX_FAILURE to ENOTEMPTY for rmdir
Browse files Browse the repository at this point in the history
Reported by Ross Lagerwall
  • Loading branch information
Miklos Szeredi committed Jan 7, 2014
1 parent c1d62f2 commit 91c1f2b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2014-01-07 Miklos Szeredi <[email protected]>

* Map SSH2_FX_FAILURE to ENOTEMPTY for rmdir. Reported by Ross
Lagerwall

2012-05-14 Miklos Szeredi <[email protected]>

* When checking root directory use LSTAT not STAT. This prevents
Expand Down
7 changes: 7 additions & 0 deletions sshfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1790,6 +1790,13 @@ static int sftp_request_wait(struct request *req, uint8_t type,
err = -EIO;
break;

case SSH_FX_FAILURE:
if (type == SSH_FXP_RMDIR)
err = -ENOTEMPTY;
else
err = -EPERM;
break;

default:
err = -sftp_error_to_errno(serr);
}
Expand Down

0 comments on commit 91c1f2b

Please sign in to comment.