classifySMBError 统一SMB错误分类
(err error)
| 621 | |
| 622 | // classifySMBError 统一SMB错误分类 |
| 623 | func classifySMBError(err error) ErrorType { |
| 624 | if err == nil { |
| 625 | return ErrorTypeUnknown |
| 626 | } |
| 627 | |
| 628 | smbAuthErrors := []string{ |
| 629 | // 通用认证错误 |
| 630 | "invalid username", |
| 631 | "invalid password", |
| 632 | "authentication failed", |
| 633 | "logon failed", |
| 634 | "logon failure", |
| 635 | "access denied", |
| 636 | "permission denied", |
| 637 | "unauthorized", |
| 638 | "login failed", |
| 639 | "bad username", |
| 640 | "bad password", |
| 641 | "wrong password", |
| 642 | "incorrect password", |
| 643 | "invalid credentials", |
| 644 | "bad credentials", |
| 645 | "authentication error", |
| 646 | "auth failed", |
| 647 | "login denied", |
| 648 | "credential", |
| 649 | "user not found", |
| 650 | "invalid account", |
| 651 | "account locked", |
| 652 | "account disabled", |
| 653 | "password expired", |
| 654 | // SMB特定错误 |
| 655 | "smb: authentication failed", |
| 656 | "smb: invalid user", |
| 657 | "smb: invalid password", |
| 658 | "smb: access denied", |
| 659 | "smb: logon failure", |
| 660 | "smb: bad password", |
| 661 | "smb: user unknown", |
| 662 | "smb: wrong password", |
| 663 | "smb: login failed", |
| 664 | "smb: unauthorized", |
| 665 | "smb2认证失败", |
| 666 | "ntlm authentication failed", |
| 667 | "ntlm auth failed", |
| 668 | // NT Status codes |
| 669 | "nt_status_logon_failure", |
| 670 | "nt_status_wrong_password", |
| 671 | "nt_status_no_such_user", |
| 672 | "nt_status_access_denied", |
| 673 | "nt_status_account_disabled", |
| 674 | "nt_status_account_locked_out", |
| 675 | "nt_status_password_expired", |
| 676 | "status_logon_failure", |
| 677 | "status_wrong_password", |
| 678 | "status_access_denied", |
| 679 | "status_invalid_parameter", |
| 680 | "status_no_such_user", |
no test coverage detected