fixing opening dir as a file
open a of a directory with a NON_DIRECTORY_FILE specified should return FILE_IS_A_DIRECTORY
This commit is contained in:
parent
4017b235db
commit
1a00a0bdce
2 changed files with 3 additions and 2 deletions
|
|
@ -498,7 +498,7 @@ static int handle_open(nfs41_upcall *upcall)
|
||||||
if (args->create_opts & FILE_NON_DIRECTORY_FILE) {
|
if (args->create_opts & FILE_NON_DIRECTORY_FILE) {
|
||||||
eprintf("trying to open directory %s as a file\n",
|
eprintf("trying to open directory %s as a file\n",
|
||||||
state->path.path);
|
state->path.path);
|
||||||
status = ERROR_ACCESS_DENIED;
|
status = ERROR_DIRECTORY;
|
||||||
goto out_free_state;
|
goto out_free_state;
|
||||||
}
|
}
|
||||||
} else if (info.type == NF4REG) {
|
} else if (info.type == NF4REG) {
|
||||||
|
|
|
||||||
|
|
@ -3276,6 +3276,7 @@ NTSTATUS map_open_errors(
|
||||||
case ERROR_SHARING_VIOLATION: return STATUS_SHARING_VIOLATION;
|
case ERROR_SHARING_VIOLATION: return STATUS_SHARING_VIOLATION;
|
||||||
case ERROR_REPARSE: return STATUS_REPARSE;
|
case ERROR_REPARSE: return STATUS_REPARSE;
|
||||||
case ERROR_TOO_MANY_LINKS: return STATUS_TOO_MANY_LINKS;
|
case ERROR_TOO_MANY_LINKS: return STATUS_TOO_MANY_LINKS;
|
||||||
|
case ERROR_DIRECTORY: return STATUS_FILE_IS_A_DIRECTORY;
|
||||||
default:
|
default:
|
||||||
print_error("[ERROR] nfs41_Create: upcall returned %d returning "
|
print_error("[ERROR] nfs41_Create: upcall returned %d returning "
|
||||||
"STATUS_INSUFFICIENT_RESOURCES\n", status);
|
"STATUS_INSUFFICIENT_RESOURCES\n", status);
|
||||||
|
|
@ -3394,7 +3395,7 @@ NTSTATUS nfs41_Create(
|
||||||
entry->u.Open.disp = params.Disposition;
|
entry->u.Open.disp = params.Disposition;
|
||||||
entry->u.Open.copts = params.CreateOptions;
|
entry->u.Open.copts = params.CreateOptions;
|
||||||
entry->u.Open.srv_open = SrvOpen;
|
entry->u.Open.srv_open = SrvOpen;
|
||||||
if (isDataAccess(params.DesiredAccess) || isOpen2Create(params.Disposition)) {
|
if (isDataAccess(params.DesiredAccess) || isOpen2Create(params.Disposition))
|
||||||
entry->u.Open.open_owner_id = InterlockedIncrement(&open_owner_id);
|
entry->u.Open.open_owner_id = InterlockedIncrement(&open_owner_id);
|
||||||
// if we are creating a file check if nfsv3attributes were passed in
|
// if we are creating a file check if nfsv3attributes were passed in
|
||||||
if (params.Disposition != FILE_OPEN && params.Disposition != FILE_OVERWRITE) {
|
if (params.Disposition != FILE_OPEN && params.Disposition != FILE_OVERWRITE) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue