Skip to content

Commit

Permalink
s3-libsmbclient Convert dos error codes to NTstatus in async libsmbcl…
Browse files Browse the repository at this point in the history
…ient.

DOS error codes were being lost with the conversion to async
libsmbclient.  If we're passing around NTSTATUS internally,
let's just convert it when we get it.

DOS ACCESS_DENIED on nautilus was not prompting for other credentials,
because it was not being mapped.
  • Loading branch information
jmcdough committed Aug 19, 2010
1 parent cbe9f87 commit 0ec0095
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions source3/libsmb/async_smb.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,7 @@ NTSTATUS cli_pull_error(char *buf)
return NT_STATUS(IVAL(buf, smb_rcls));
}

/* if the client uses dos errors, but there is no error,
we should return no error here, otherwise it looks
like an unknown bad NT_STATUS. jmcd */
if (CVAL(buf, smb_rcls) == 0)
return NT_STATUS_OK;

return NT_STATUS_DOS(CVAL(buf, smb_rcls), SVAL(buf,smb_err));
return dos_to_ntstatus(CVAL(buf, smb_rcls), SVAL(buf,smb_err));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion source3/libsmb/errormap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ convert a dos eclas/ecode to a NT status32 code
NTSTATUS dos_to_ntstatus(uint8 eclass, uint32 ecode)
{
int i;
if (eclass == 0 && ecode == 0) return NT_STATUS_OK;
if (eclass == 0) return NT_STATUS_OK;
for (i=0; NT_STATUS_V(dos_to_ntstatus_map[i].ntstatus); i++) {
if (eclass == dos_to_ntstatus_map[i].dos_class &&
ecode == dos_to_ntstatus_map[i].dos_code) {
Expand Down

0 comments on commit 0ec0095

Please sign in to comment.