Address Renaming Issue With exFAT File Systems (#381)

- Updated Win32 error translation table to translate ERROR_INVALID_FUNCTION as EOPNOTSUPP which in turn allows the SFTP rename capability to failover to rename() when link()/unlink() combination does not work due to the volume not supporting it.
- Addressed file security descriptor with no defined DACL.
PowerShell/Win32-OpenSSH#1357
This commit is contained in:
Bryan Berns 2019-03-25 12:53:23 -04:00 committed by Manoj Ampalam
parent 68ad673db4
commit 2abb7748a9
2 changed files with 5 additions and 2 deletions

View File

@ -98,6 +98,8 @@ errno_from_Win32Error(int win32_error)
case ERROR_PATH_NOT_FOUND:
case ERROR_INVALID_NAME:
return ENOENT;
case ERROR_INVALID_FUNCTION:
return EOPNOTSUPP;
default:
return win32_error;
}

View File

@ -1250,8 +1250,9 @@ get_others_file_permissions(wchar_t * file_name, int isReadOnlyFile)
goto cleanup;
}
if (((is_valid_sid = IsValidSid(owner_sid)) == FALSE) || ((is_valid_acl = IsValidAcl(dacl)) == FALSE)) {
debug3("IsValidSid: %d; is_valid_acl: %d", is_valid_sid, is_valid_acl);
if (((is_valid_sid = IsValidSid(owner_sid)) == FALSE) || dacl == NULL ||
((is_valid_acl = IsValidAcl(dacl)) == FALSE)) {
debug3("IsValidSid: %d; NULL Acl: %d; IsValidAcl: %d", is_valid_sid, dacl == NULL, is_valid_acl);
goto cleanup;
}