summaryrefslogtreecommitdiffstats
path: root/source/pam_smbpass/pam_smb_auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/pam_smbpass/pam_smb_auth.c')
-rw-r--r--source/pam_smbpass/pam_smb_auth.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source/pam_smbpass/pam_smb_auth.c b/source/pam_smbpass/pam_smb_auth.c
index e5cc12e2f6d..6a3e6e56598 100644
--- a/source/pam_smbpass/pam_smb_auth.c
+++ b/source/pam_smbpass/pam_smb_auth.c
@@ -47,6 +47,8 @@ do { \
static int _smb_add_user(pam_handle_t *pamh, unsigned int ctrl,
const char *name, SAM_ACCOUNT *sampass, BOOL exist);
+int make_remark(pam_handle_t *, unsigned int, int, const char *);
+
/*
* pam_sm_authenticate() authenticates users against the samba password file.
@@ -73,6 +75,8 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
/* Samba initialization. */
setup_logging("pam_smbpass",False);
+ charset_initialise();
+ codepage_initialise(lp_client_code_page());
in_client = True;
ctrl = set_ctrl(flags, argc, argv);
@@ -105,14 +109,14 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
if (on( SMB_MIGRATE, ctrl )) {
retval = _smb_add_user(pamh, ctrl, name, sampass, found);
- pdb_free_sam(&sampass);
+ pdb_free_sam(sampass);
AUTH_RETURN;
}
if (!found) {
_log_err(LOG_ALERT, "Failed to find entry for user %s.", name);
retval = PAM_USER_UNKNOWN;
- pdb_free_sam(&sampass);
+ pdb_free_sam(sampass);
sampass = NULL;
AUTH_RETURN;
}
@@ -120,7 +124,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
/* if this user does not have a password... */
if (_smb_blankpasswd( ctrl, sampass )) {
- pdb_free_sam(&sampass);
+ pdb_free_sam(sampass);
retval = PAM_SUCCESS;
AUTH_RETURN;
}
@@ -131,14 +135,14 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
if (retval != PAM_SUCCESS ) {
_log_err(LOG_CRIT, "auth: no password provided for [%s]"
, name);
- pdb_free_sam(&sampass);
+ pdb_free_sam(sampass);
AUTH_RETURN;
}
/* verify the password of this user */
retval = _smb_verify_password( pamh, sampass, p, ctrl );
- pdb_free_sam(&sampass);
+ pdb_free_sam(sampass);
p = NULL;
AUTH_RETURN;
}
@@ -172,7 +176,7 @@ static int _smb_add_user(pam_handle_t *pamh, unsigned int ctrl,
{
pstring err_str;
pstring msg_str;
- const char *pass = NULL;
+ char *pass = NULL;
int retval;
err_str[0] = '\0';