scp: return better error messages

Fixes #171
This commit is contained in:
Nicola Murino
2020-09-18 19:13:09 +02:00
parent 242dde4480
commit 209badf10c
5 changed files with 59 additions and 18 deletions

View File

@@ -183,6 +183,16 @@ func (OsFs) IsPermission(err error) bool {
return os.IsPermission(err)
}
// GetPermissionError returns a permission error for this FS
func (OsFs) GetPermissionError() error {
return os.ErrPermission
}
// GetNotExistError returns a not exist error for this FS
func (OsFs) GetNotExistError() error {
return os.ErrNotExist
}
// CheckRootPath creates the root directory if it does not exists
func (fs OsFs) CheckRootPath(username string, uid int, gid int) bool {
var err error