mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
r20851: To read account policies from LDAP we need root.
Volker
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
fb730e1e7b
commit
b48ea4d777
@ -1382,6 +1382,7 @@ BOOL pdb_update_bad_password_count(struct samu *sampass, BOOL *updated)
|
|||||||
time_t LastBadPassword;
|
time_t LastBadPassword;
|
||||||
uint16 BadPasswordCount;
|
uint16 BadPasswordCount;
|
||||||
uint32 resettime;
|
uint32 resettime;
|
||||||
|
BOOL res;
|
||||||
|
|
||||||
BadPasswordCount = pdb_get_bad_password_count(sampass);
|
BadPasswordCount = pdb_get_bad_password_count(sampass);
|
||||||
if (!BadPasswordCount) {
|
if (!BadPasswordCount) {
|
||||||
@ -1389,7 +1390,11 @@ BOOL pdb_update_bad_password_count(struct samu *sampass, BOOL *updated)
|
|||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pdb_get_account_policy(AP_RESET_COUNT_TIME, &resettime)) {
|
become_root_uid_only();
|
||||||
|
res = pdb_get_account_policy(AP_RESET_COUNT_TIME, &resettime);
|
||||||
|
unbecome_root_uid_only();
|
||||||
|
|
||||||
|
if (!res) {
|
||||||
DEBUG(0, ("pdb_update_bad_password_count: pdb_get_account_policy failed.\n"));
|
DEBUG(0, ("pdb_update_bad_password_count: pdb_get_account_policy failed.\n"));
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
@ -1422,6 +1427,7 @@ BOOL pdb_update_autolock_flag(struct samu *sampass, BOOL *updated)
|
|||||||
{
|
{
|
||||||
uint32 duration;
|
uint32 duration;
|
||||||
time_t LastBadPassword;
|
time_t LastBadPassword;
|
||||||
|
BOOL res;
|
||||||
|
|
||||||
if (!(pdb_get_acct_ctrl(sampass) & ACB_AUTOLOCK)) {
|
if (!(pdb_get_acct_ctrl(sampass) & ACB_AUTOLOCK)) {
|
||||||
DEBUG(9, ("pdb_update_autolock_flag: Account %s not autolocked, no check needed\n",
|
DEBUG(9, ("pdb_update_autolock_flag: Account %s not autolocked, no check needed\n",
|
||||||
@ -1429,7 +1435,11 @@ BOOL pdb_update_autolock_flag(struct samu *sampass, BOOL *updated)
|
|||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pdb_get_account_policy(AP_LOCK_ACCOUNT_DURATION, &duration)) {
|
become_root_uid_only();
|
||||||
|
res = pdb_get_account_policy(AP_LOCK_ACCOUNT_DURATION, &duration);
|
||||||
|
unbecome_root_uid_only();
|
||||||
|
|
||||||
|
if (!res) {
|
||||||
DEBUG(0, ("pdb_update_autolock_flag: pdb_get_account_policy failed.\n"));
|
DEBUG(0, ("pdb_update_autolock_flag: pdb_get_account_policy failed.\n"));
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user