summaryrefslogtreecommitdiffstats
path: root/source3/passdb
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2007-02-22 20:52:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:09 -0500
commit2b52e35770270959d5029fa84932d436652c7193 (patch)
tree08d6d87798509ce14c5da93c9b9c357f00f2897f /source3/passdb
parent1945571e3b899bee8a33122bece723ce87b7daed (diff)
downloadsamba-2b52e35770270959d5029fa84932d436652c7193.tar.gz
samba-2b52e35770270959d5029fa84932d436652c7193.tar.xz
samba-2b52e35770270959d5029fa84932d436652c7193.zip
r21507: Fix some "cannot access LDAP when no root" bugs.
The two culprits were * pdb_get_account_policy() * pdb_get_group_sid() (This used to be commit 6a69caf6907fad01b13aa4358ce5c62506f98495)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_interface.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c
index 36536e5feac..ce8b46eb0f3 100644
--- a/source3/passdb/pdb_interface.c
+++ b/source3/passdb/pdb_interface.c
@@ -987,13 +987,25 @@ NTSTATUS pdb_lookup_names(const DOM_SID *domain_sid,
BOOL pdb_get_account_policy(int policy_index, uint32 *value)
{
struct pdb_methods *pdb = pdb_get_methods();
- return NT_STATUS_IS_OK(pdb->get_account_policy(pdb, policy_index, value));
+ NTSTATUS status;
+
+ become_root();
+ status = pdb->get_account_policy(pdb, policy_index, value);
+ unbecome_root();
+
+ return NT_STATUS_IS_OK(status);
}
BOOL pdb_set_account_policy(int policy_index, uint32 value)
{
struct pdb_methods *pdb = pdb_get_methods();
- return NT_STATUS_IS_OK(pdb->set_account_policy(pdb, policy_index, value));
+ NTSTATUS status;
+
+ become_root();
+ status = pdb->set_account_policy(pdb, policy_index, value);
+ unbecome_root();
+
+ return NT_STATUS_IS_OK(status);
}
BOOL pdb_get_seq_num(time_t *seq_num)