mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +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 used to be commit c2c004a620
)
This commit is contained in:
parent
60bcd1bd77
commit
69981e3341
@ -327,14 +327,20 @@ static int process_root(int local_flags)
|
||||
char *old_passwd = NULL;
|
||||
|
||||
if (local_flags & LOCAL_SET_LDAP_ADMIN_PW) {
|
||||
printf("Setting stored password for \"%s\" in secrets.tdb\n",
|
||||
lp_ldap_admin_dn());
|
||||
char *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 ) {
|
||||
new_passwd = prompt_for_new_password(stdin_passwd_get);
|
||||
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"));
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user