mirror of
https://github.com/samba-team/samba.git
synced 2025-02-05 21:57:51 +03:00
r13148: Fix bug: #3413
Check that ldap admin dn is defined in smb.conf before setting the ldap password in secrets.tdb Based on patch by William Jojo <jojowil@hvcc.edu> Simo.
This commit is contained in:
parent
47178b1b5a
commit
c2c004a620
@ -327,14 +327,20 @@ static int process_root(int local_flags)
|
|||||||
char *old_passwd = NULL;
|
char *old_passwd = NULL;
|
||||||
|
|
||||||
if (local_flags & LOCAL_SET_LDAP_ADMIN_PW) {
|
if (local_flags & LOCAL_SET_LDAP_ADMIN_PW) {
|
||||||
printf("Setting stored password for \"%s\" in secrets.tdb\n",
|
char *ldap_admin_dn = lp_ldap_admin_dn();
|
||||||
lp_ldap_admin_dn());
|
if ( ! *ldap_admin_dn ) {
|
||||||
|
DEBUG(0,("ERROR: 'ldap admin dn' not defined! Please check your smb.conf\n"));
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Setting stored password for \"%s\" in secrets.tdb\n", ldap_admin_dn);
|
||||||
if ( ! *ldap_secret ) {
|
if ( ! *ldap_secret ) {
|
||||||
new_passwd = prompt_for_new_password(stdin_passwd_get);
|
new_passwd = prompt_for_new_password(stdin_passwd_get);
|
||||||
fstrcpy(ldap_secret, new_passwd);
|
fstrcpy(ldap_secret, new_passwd);
|
||||||
}
|
}
|
||||||
if (!store_ldap_admin_pw(ldap_secret))
|
if (!store_ldap_admin_pw(ldap_secret)) {
|
||||||
DEBUG(0,("ERROR: Failed to store the ldap admin password!\n"));
|
DEBUG(0,("ERROR: Failed to store the ldap admin password!\n"));
|
||||||
|
}
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user