summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-08-19 13:36:39 +0200
committerGünther Deschner <gd@samba.org>2008-10-10 15:38:29 +0200
commitb1282d720cffeb4b89bc5276b827e60ccef3f110 (patch)
treefb30214f77252b72774ed9fb8d1d712acfcb820a /source3
parent0566164db03a19b98d4aec5cca63ece2a01acbec (diff)
downloadsamba-b1282d720cffeb4b89bc5276b827e60ccef3f110.tar.gz
samba-b1282d720cffeb4b89bc5276b827e60ccef3f110.tar.bz2
samba-b1282d720cffeb4b89bc5276b827e60ccef3f110.zip
pam_winbind: add _pam_check_remark_auth_err().
Guenther
Diffstat (limited to 'source3')
-rw-r--r--source3/nsswitch/pam_winbind.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/source3/nsswitch/pam_winbind.c b/source3/nsswitch/pam_winbind.c
index c840bba9d4..41dacd7105 100644
--- a/source3/nsswitch/pam_winbind.c
+++ b/source3/nsswitch/pam_winbind.c
@@ -1292,6 +1292,47 @@ static void _pam_warn_krb5_failure(struct pwb_context *ctx,
}
}
+static bool _pam_check_remark_auth_err(struct pwb_context *ctx,
+ const struct wbcAuthErrorInfo *e,
+ const char *nt_status_string,
+ int *pam_error)
+{
+ const char *ntstatus = NULL;
+ const char *error_string = NULL;
+
+ if (!e || !pam_error) {
+ return false;
+ }
+
+ ntstatus = e->nt_string;
+ if (!ntstatus) {
+ return false;
+ }
+
+ if (strcasecmp(ntstatus, nt_status_string) == 0) {
+
+ error_string = _get_ntstatus_error_string(nt_status_string);
+ if (error_string) {
+ _make_remark(ctx, PAM_ERROR_MSG, error_string);
+ *pam_error = e->pam_error;
+ return true;
+ }
+
+ if (e->display_string) {
+ _make_remark(ctx, PAM_ERROR_MSG, e->display_string);
+ *pam_error = e->pam_error;
+ return true;
+ }
+
+ _make_remark(ctx, PAM_ERROR_MSG, nt_status_string);
+ *pam_error = e->pam_error;
+
+ return true;
+ }
+
+ return false;
+};
+
/**
* Compose Password Restriction String for a PAM_ERROR_MSG conversation.
*