mirror of
https://github.com/samba-team/samba.git
synced 2025-02-23 09:57:40 +03:00
pam_smbpass updates from a.bokovoy@sam-solutions.net
(This used to be commit 016e203a2c5286d8b48ab3eff0226affc203deaf)
This commit is contained in:
parent
6526a42558
commit
65cfe6a492
@ -69,7 +69,7 @@ int pam_sm_acct_mgmt( pam_handle_t *pamh, int flags,
|
||||
_log_err( LOG_DEBUG, "acct: username [%s] obtained", name );
|
||||
}
|
||||
|
||||
if (!initialize_password_db()) {
|
||||
if (!initialize_password_db(True)) {
|
||||
_log_err( LOG_ALERT, "Cannot access samba password database" );
|
||||
return PAM_AUTHINFO_UNAVAIL;
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
|
||||
_log_err( LOG_DEBUG, "username [%s] obtained", name );
|
||||
}
|
||||
|
||||
if (!initialize_password_db()) {
|
||||
if (!initialize_password_db(True)) {
|
||||
_log_err( LOG_ALERT, "Cannot access samba password database" );
|
||||
retval = PAM_AUTHINFO_UNAVAIL;
|
||||
AUTH_RETURN;
|
||||
|
@ -119,7 +119,7 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
|
||||
_log_err( LOG_DEBUG, "username [%s] obtained", user );
|
||||
}
|
||||
|
||||
if (!initialize_password_db()) {
|
||||
if (!initialize_password_db(True)) {
|
||||
_log_err( LOG_ALERT, "Cannot access samba password database" );
|
||||
return PAM_AUTHINFO_UNAVAIL;
|
||||
}
|
||||
|
@ -125,8 +125,7 @@ int make_remark( pam_handle_t * pamh, unsigned int ctrl
|
||||
int set_ctrl( int flags, int argc, const char **argv )
|
||||
{
|
||||
int i = 0;
|
||||
static pstring servicesf = dyn_CONFIGFILE;
|
||||
const char *service_file = servicesf;
|
||||
const char *service_file = dyn_CONFIGFILE;
|
||||
unsigned int ctrl;
|
||||
|
||||
ctrl = SMB_DEFAULTS; /* the default selection of options */
|
||||
@ -216,32 +215,6 @@ void _cleanup( pam_handle_t * pamh, void *x, int error_status )
|
||||
x = _pam_delete( (char *) x );
|
||||
}
|
||||
|
||||
/*
|
||||
* Safe duplication of character strings. "Paranoid"; don't leave
|
||||
* evidence of old token around for later stack analysis.
|
||||
*/
|
||||
|
||||
char * smb_xstrdup( const char *x )
|
||||
{
|
||||
register char *new = NULL;
|
||||
|
||||
if (x != NULL) {
|
||||
register int i;
|
||||
|
||||
for (i = 0; x[i]; ++i); /* length of string */
|
||||
if ((new = malloc(++i)) == NULL) {
|
||||
i = 0;
|
||||
_log_err( LOG_CRIT, "out of memory in smb_xstrdup" );
|
||||
} else {
|
||||
while (i-- > 0) {
|
||||
new[i] = x[i];
|
||||
}
|
||||
}
|
||||
x = NULL;
|
||||
}
|
||||
return new; /* return the duplicate or NULL on error */
|
||||
}
|
||||
|
||||
/* ************************************************************** *
|
||||
* Useful non-trivial functions *
|
||||
* ************************************************************** */
|
||||
|
Loading…
x
Reference in New Issue
Block a user