1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

Don't check for passwd program if using pam change password.

Original patch from Andrew Bartlett.
Jeremy.
This commit is contained in:
Jeremy Allison 0001-01-01 00:00:00 +00:00
parent dd0c7a8a02
commit aae779d0a3

View File

@ -93,29 +93,37 @@ to a valid password server.\n", sec_setting );
if(lp_security() == SEC_USER && lp_unix_password_sync()) {
/*
* Check that we have a valid lp_passwd_program().
* Check that we have a valid lp_passwd_program() if not using pam.
*/
if(lp_passwd_program() == NULL) {
printf("ERROR: the 'unix password sync' parameter is set and there is no valid 'passwd program' \
#ifdef WITH_PAM
if (!lp_pam_password_change()) {
#endif
if(lp_passwd_program() == NULL) {
printf("ERROR: the 'unix password sync' parameter is set and there is no valid 'passwd program' \
parameter.\n" );
ret = 1;
} else {
pstring passwd_prog;
pstring truncated_prog;
char *p;
pstrcpy( passwd_prog, lp_passwd_program());
p = passwd_prog;
*truncated_prog = '\0';
next_token(&p, truncated_prog, NULL, sizeof(pstring));
if(access(truncated_prog, F_OK) == -1) {
printf("ERROR: the 'unix password sync' parameter is set and the 'passwd program' (%s) \
cannot be executed (error was %s).\n", truncated_prog, strerror(errno) );
ret = 1;
} else {
pstring passwd_prog;
pstring truncated_prog;
char *p;
pstrcpy( passwd_prog, lp_passwd_program());
p = passwd_prog;
*truncated_prog = '\0';
next_token(&p, truncated_prog, NULL, sizeof(pstring));
if(access(truncated_prog, F_OK) == -1) {
printf("ERROR: the 'unix password sync' parameter is set and the 'passwd program' (%s) \
cannot be executed (error was %s).\n", truncated_prog, strerror(errno) );
ret = 1;
}
}
#ifdef WITH_PAM
}
#endif
if(lp_passwd_chat() == NULL) {
printf("ERROR: the 'unix password sync' parameter is set and there is no valid 'passwd chat' \