diff options
author | Günther Deschner <gd@samba.org> | 2008-08-15 03:13:18 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-10-10 15:38:13 +0200 |
commit | 0532291fe9650f968aab0fb6b60e08f41b334c24 (patch) | |
tree | 6e713dd80aeeaa02a383f9fa17b0542066f72e84 /source3/nsswitch | |
parent | 7817ad4ae0c462429f176ddf94bebcd44a3d6619 (diff) | |
download | samba-0532291fe9650f968aab0fb6b60e08f41b334c24.tar.gz samba-0532291fe9650f968aab0fb6b60e08f41b334c24.tar.bz2 samba-0532291fe9650f968aab0fb6b60e08f41b334c24.zip |
pam_winbind: add wbc_error_to_pam_error().
Guenther
Diffstat (limited to 'source3/nsswitch')
-rw-r--r-- | source3/nsswitch/pam_winbind.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/source3/nsswitch/pam_winbind.c b/source3/nsswitch/pam_winbind.c index cdb30edad4..e8f2459568 100644 --- a/source3/nsswitch/pam_winbind.c +++ b/source3/nsswitch/pam_winbind.c @@ -12,6 +12,42 @@ #include "pam_winbind.h" +static int wbc_error_to_pam_error(wbcErr status) +{ + switch (status) { + case WBC_ERR_SUCCESS: + return PAM_SUCCESS; + case WBC_ERR_NOT_IMPLEMENTED: + return PAM_SERVICE_ERR; + case WBC_ERR_UNKNOWN_FAILURE: + break; + case WBC_ERR_NO_MEMORY: + return PAM_BUF_ERR; + case WBC_ERR_INVALID_SID: + case WBC_ERR_INVALID_PARAM: + break; + case WBC_ERR_WINBIND_NOT_AVAILABLE: + return PAM_AUTHINFO_UNAVAIL; + case WBC_ERR_DOMAIN_NOT_FOUND: + return PAM_AUTHINFO_UNAVAIL; + case WBC_ERR_INVALID_RESPONSE: + return PAM_BUF_ERR; + case WBC_ERR_NSS_ERROR: + return PAM_USER_UNKNOWN; + case WBC_ERR_AUTH_ERROR: + return PAM_AUTH_ERR; + case WBC_ERR_UNKNOWN_USER: + return PAM_USER_UNKNOWN; + case WBC_ERR_UNKNOWN_GROUP: + return PAM_USER_UNKNOWN; + case WBC_ERR_PWD_CHANGE_FAILED: + break; + } + + /* be paranoid */ + return PAM_AUTH_ERR; +} + static const char *_pam_error_code_str(int err) { switch (err) { |