mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 15:03:53 +02:00
cifs: Change translation of STATUS_PRIVILEGE_NOT_HELD to -EPERM
STATUS_PRIVILEGE_NOT_HELD indicates that user does not have privilege to issue some operation, for example to create symlink. Currently STATUS_PRIVILEGE_NOT_HELD is translated to -EIO. Change it to -EPERM which better describe this error code. Note that there is no ERR* code usable in ntstatus_to_dos_map[] table which can be used to -EPERM translation, so do explicit translation in map_smb_to_linux_error() function. Signed-off-by: Pali Rohár <pali@kernel.org> Acked-by: Tom Talpey <tom@talpey.com> Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.com> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
f764fab72d
commit
438e2116d7
|
@ -313,7 +313,6 @@ static const struct {
|
|||
ERRDOS, 2215, NT_STATUS_NO_LOGON_SERVERS}, {
|
||||
ERRHRD, ERRgeneral, NT_STATUS_NO_SUCH_LOGON_SESSION}, {
|
||||
ERRHRD, ERRgeneral, NT_STATUS_NO_SUCH_PRIVILEGE}, {
|
||||
ERRDOS, ERRnoaccess, NT_STATUS_PRIVILEGE_NOT_HELD}, {
|
||||
ERRHRD, ERRgeneral, NT_STATUS_INVALID_ACCOUNT_NAME}, {
|
||||
ERRHRD, ERRgeneral, NT_STATUS_USER_EXISTS},
|
||||
/* { This NT error code was 'sqashed'
|
||||
|
@ -876,6 +875,8 @@ map_smb_to_linux_error(char *buf, bool logErr)
|
|||
__u32 err = le32_to_cpu(smb->Status.CifsError);
|
||||
if (err == (NT_STATUS_NOT_A_REPARSE_POINT))
|
||||
rc = -ENODATA;
|
||||
else if (err == (NT_STATUS_PRIVILEGE_NOT_HELD))
|
||||
rc = -EPERM;
|
||||
}
|
||||
|
||||
cifs_dbg(FYI, "Mapping smb error code 0x%x to POSIX err %d\n",
|
||||
|
|
|
@ -380,7 +380,7 @@ static const struct status_to_posix_error smb2_error_map_table[] = {
|
|||
{STATUS_NO_LOGON_SERVERS, -EIO, "STATUS_NO_LOGON_SERVERS"},
|
||||
{STATUS_NO_SUCH_LOGON_SESSION, -EIO, "STATUS_NO_SUCH_LOGON_SESSION"},
|
||||
{STATUS_NO_SUCH_PRIVILEGE, -EIO, "STATUS_NO_SUCH_PRIVILEGE"},
|
||||
{STATUS_PRIVILEGE_NOT_HELD, -EIO, "STATUS_PRIVILEGE_NOT_HELD"},
|
||||
{STATUS_PRIVILEGE_NOT_HELD, -EPERM, "STATUS_PRIVILEGE_NOT_HELD"},
|
||||
{STATUS_INVALID_ACCOUNT_NAME, -EIO, "STATUS_INVALID_ACCOUNT_NAME"},
|
||||
{STATUS_USER_EXISTS, -EIO, "STATUS_USER_EXISTS"},
|
||||
{STATUS_NO_SUCH_USER, -EIO, "STATUS_NO_SUCH_USER"},
|
||||
|
|
Loading…
Reference in New Issue
Block a user