* ntdll.h (STATUS_ACCESS_DENIED): Define.
* syscalls.cc (check_dir_not_empty): New static function. (unlink_nt): Move code checking for non-empty dir to check_dir_not_empty and call check_dir_not_empty instead. (rename): Add fault handler. Check oldpath and newpath for trailing . and .. path components and return EINVAL if so. Check oldpath for being on a vrtual file system. If renaming a dir fails with STATUS_ACCESS_DENIED, check if the target dir is non-empty and return ENOTEMPTY if so.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#define STATUS_INVALID_PARAMETER ((NTSTATUS) 0xc000000d)
|
||||
#define STATUS_INVALID_DEVICE_REQUEST ((NTSTATUS) 0xc0000010)
|
||||
#define STATUS_NO_MEDIA_IN_DEVICE ((NTSTATUS) 0xc0000013)
|
||||
#define STATUS_ACCESS_DENIED ((NTSTATUS) 0xc0000022)
|
||||
#define STATUS_BUFFER_TOO_SMALL ((NTSTATUS) 0xc0000023)
|
||||
#define STATUS_OBJECT_NAME_NOT_FOUND ((NTSTATUS) 0xc0000034)
|
||||
#define STATUS_SHARING_VIOLATION ((NTSTATUS) 0xc0000043)
|
||||
|
Reference in New Issue
Block a user