aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/netmisc.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2007-10-18 17:45:27 -0400
committerSteve French <sfrench@us.ibm.com>2007-10-18 17:45:27 -0400
commita761ac579b89bc1f00212a42401398108deba65c (patch)
tree5345eaf8fa239af7f8f28989bea7942b0ab8ea13 /fs/cifs/netmisc.c
parentabb63d6c3d3d0e4d93b63589135962091154be9b (diff)
[CIFS] log better errors on failed mounts
Also returns more accurate errors to mount for the cases of account expired and password expired Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/netmisc.c')
-rw-r--r--fs/cifs/netmisc.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
index 9ae4941cd61d..f06359cb22ee 100644
--- a/fs/cifs/netmisc.c
+++ b/fs/cifs/netmisc.c
@@ -114,10 +114,16 @@ static const struct smb_to_posix_error mapping_table_ERRSRV[] = {
114 {ERRusempx, -EIO}, 114 {ERRusempx, -EIO},
115 {ERRusestd, -EIO}, 115 {ERRusestd, -EIO},
116 {ERR_NOTIFY_ENUM_DIR, -ENOBUFS}, 116 {ERR_NOTIFY_ENUM_DIR, -ENOBUFS},
117 {ERRaccountexpired, -EACCES}, 117 {ERRnoSuchUser, -EACCES},
118/* {ERRaccountexpired, -EACCES},
118 {ERRbadclient, -EACCES}, 119 {ERRbadclient, -EACCES},
119 {ERRbadLogonTime, -EACCES}, 120 {ERRbadLogonTime, -EACCES},
120 {ERRpasswordExpired, -EACCES}, 121 {ERRpasswordExpired, -EACCES},*/
122 {ERRaccountexpired, -EKEYEXPIRED},
123 {ERRbadclient, -EACCES},
124 {ERRbadLogonTime, -EACCES},
125 {ERRpasswordExpired, -EKEYEXPIRED},
126
121 {ERRnosupport, -EINVAL}, 127 {ERRnosupport, -EINVAL},
122 {0, 0} 128 {0, 0}
123}; 129};
@@ -270,7 +276,7 @@ static const struct {
270 from NT_STATUS_NO_SUCH_USER to NT_STATUS_LOGON_FAILURE 276 from NT_STATUS_NO_SUCH_USER to NT_STATUS_LOGON_FAILURE
271 during the session setup } */ 277 during the session setup } */
272 { 278 {
273 ERRDOS, ERRnoaccess, NT_STATUS_NO_SUCH_USER}, { 279 ERRDOS, ERRnoaccess, NT_STATUS_NO_SUCH_USER}, { /* could map to 2238 */
274 ERRHRD, ERRgeneral, NT_STATUS_GROUP_EXISTS}, { 280 ERRHRD, ERRgeneral, NT_STATUS_GROUP_EXISTS}, {
275 ERRHRD, ERRgeneral, NT_STATUS_NO_SUCH_GROUP}, { 281 ERRHRD, ERRgeneral, NT_STATUS_NO_SUCH_GROUP}, {
276 ERRHRD, ERRgeneral, NT_STATUS_MEMBER_IN_GROUP}, { 282 ERRHRD, ERRgeneral, NT_STATUS_MEMBER_IN_GROUP}, {
@@ -285,10 +291,10 @@ static const struct {
285 ERRHRD, ERRgeneral, NT_STATUS_PASSWORD_RESTRICTION}, { 291 ERRHRD, ERRgeneral, NT_STATUS_PASSWORD_RESTRICTION}, {
286 ERRDOS, ERRnoaccess, NT_STATUS_LOGON_FAILURE}, { 292 ERRDOS, ERRnoaccess, NT_STATUS_LOGON_FAILURE}, {
287 ERRHRD, ERRgeneral, NT_STATUS_ACCOUNT_RESTRICTION}, { 293 ERRHRD, ERRgeneral, NT_STATUS_ACCOUNT_RESTRICTION}, {
288 ERRSRV, 2241, NT_STATUS_INVALID_LOGON_HOURS}, { 294 ERRSRV, ERRbadLogonTime, NT_STATUS_INVALID_LOGON_HOURS}, {
289 ERRSRV, 2240, NT_STATUS_INVALID_WORKSTATION}, { 295 ERRSRV, ERRbadclient, NT_STATUS_INVALID_WORKSTATION}, {
290 ERRSRV, ERRpasswordExpired, NT_STATUS_PASSWORD_EXPIRED}, { 296 ERRSRV, ERRpasswordExpired, NT_STATUS_PASSWORD_EXPIRED}, {
291 ERRSRV, 2239, NT_STATUS_ACCOUNT_DISABLED}, { 297 ERRSRV, ERRaccountexpired, NT_STATUS_ACCOUNT_DISABLED}, {
292 ERRHRD, ERRgeneral, NT_STATUS_NONE_MAPPED}, { 298 ERRHRD, ERRgeneral, NT_STATUS_NONE_MAPPED}, {
293 ERRHRD, ERRgeneral, NT_STATUS_TOO_MANY_LUIDS_REQUESTED}, { 299 ERRHRD, ERRgeneral, NT_STATUS_TOO_MANY_LUIDS_REQUESTED}, {
294 ERRHRD, ERRgeneral, NT_STATUS_LUIDS_EXHAUSTED}, { 300 ERRHRD, ERRgeneral, NT_STATUS_LUIDS_EXHAUSTED}, {
@@ -585,7 +591,7 @@ static const struct {
585 ERRDOS, ERRnoaccess, NT_STATUS_TRUST_FAILURE}, { 591 ERRDOS, ERRnoaccess, NT_STATUS_TRUST_FAILURE}, {
586 ERRHRD, ERRgeneral, NT_STATUS_MUTANT_LIMIT_EXCEEDED}, { 592 ERRHRD, ERRgeneral, NT_STATUS_MUTANT_LIMIT_EXCEEDED}, {
587 ERRDOS, ERRnetlogonNotStarted, NT_STATUS_NETLOGON_NOT_STARTED}, { 593 ERRDOS, ERRnetlogonNotStarted, NT_STATUS_NETLOGON_NOT_STARTED}, {
588 ERRSRV, 2239, NT_STATUS_ACCOUNT_EXPIRED}, { 594 ERRSRV, ERRaccountexpired, NT_STATUS_ACCOUNT_EXPIRED}, {
589 ERRHRD, ERRgeneral, NT_STATUS_POSSIBLE_DEADLOCK}, { 595 ERRHRD, ERRgeneral, NT_STATUS_POSSIBLE_DEADLOCK}, {
590 ERRHRD, ERRgeneral, NT_STATUS_NETWORK_CREDENTIAL_CONFLICT}, { 596 ERRHRD, ERRgeneral, NT_STATUS_NETWORK_CREDENTIAL_CONFLICT}, {
591 ERRHRD, ERRgeneral, NT_STATUS_REMOTE_SESSION_LIMIT}, { 597 ERRHRD, ERRgeneral, NT_STATUS_REMOTE_SESSION_LIMIT}, {
@@ -754,7 +760,7 @@ ntstatus_to_dos(__u32 ntstatus, __u8 * eclass, __u16 * ecode)
754} 760}
755 761
756int 762int
757map_smb_to_linux_error(struct smb_hdr *smb) 763map_smb_to_linux_error(struct smb_hdr *smb, int logErr)
758{ 764{
759 unsigned int i; 765 unsigned int i;
760 int rc = -EIO; /* if transport error smb error may not be set */ 766 int rc = -EIO; /* if transport error smb error may not be set */
@@ -771,7 +777,9 @@ map_smb_to_linux_error(struct smb_hdr *smb)
771 /* translate the newer STATUS codes to old style SMB errors 777 /* translate the newer STATUS codes to old style SMB errors
772 * and then to POSIX errors */ 778 * and then to POSIX errors */
773 __u32 err = le32_to_cpu(smb->Status.CifsError); 779 __u32 err = le32_to_cpu(smb->Status.CifsError);
774 if (cifsFYI & CIFS_RC) 780 if (logErr && (err != (NT_STATUS_MORE_PROCESSING_REQUIRED)))
781 cifs_print_status(err);
782 else if (cifsFYI & CIFS_RC)
775 cifs_print_status(err); 783 cifs_print_status(err);
776 ntstatus_to_dos(err, &smberrclass, &smberrcode); 784 ntstatus_to_dos(err, &smberrclass, &smberrcode);
777 } else { 785 } else {
@@ -813,7 +821,7 @@ map_smb_to_linux_error(struct smb_hdr *smb)
813 } 821 }
814 /* else ERRHRD class errors or junk - return EIO */ 822 /* else ERRHRD class errors or junk - return EIO */
815 823
816 cFYI(1, (" !!Mapping smb error code %d to POSIX err %d !!", 824 cFYI(1, ("Mapping smb error code %d to POSIX err %d",
817 smberrcode, rc)); 825 smberrcode, rc));
818 826
819 /* generic corrective action e.g. reconnect SMB session on 827 /* generic corrective action e.g. reconnect SMB session on