Commit d337a44e authored by Marios Makassikis's avatar Marios Makassikis Committed by Namjae Jeon

ksmbd: Return STATUS_OBJECT_PATH_NOT_FOUND if smb2_creat() returns ENOENT

Both Windows 10's SMB server and samba return STATUS_OBJECT_PATH_NOT_FOUND
when trying to access a nonexistent path.

This fixes Windows 10 File History tool. The latter relies on the server
returning STATUS_OBJECT_PATH_NOT_FOUND to figure out what part of the
target path needs to be created. Returning STATUS_OBJECT_NAME_INVALID
will make it stop and display an error to the user.
Signed-off-by: default avatarMarios Makassikis <mmakassikis@freebox.fr>
Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 1d904eaf
......@@ -2768,8 +2768,13 @@ int smb2_open(struct ksmbd_work *work)
if (!file_present) {
rc = smb2_creat(work, &path, name, open_flags, posix_mode,
req->CreateOptions & FILE_DIRECTORY_FILE_LE);
if (rc)
if (rc) {
if (rc == -ENOENT) {
rc = -EIO;
rsp->hdr.Status = STATUS_OBJECT_PATH_NOT_FOUND;
}
goto err_out;
}
created = true;
user_ns = mnt_user_ns(path.mnt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment