summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/passdb.c53
-rw-r--r--source3/passdb/pdb_tdb.c2
2 files changed, 1 insertions, 54 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index c93577dc04..b13ecf7a33 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -428,59 +428,6 @@ NTSTATUS pdb_set_sam_sids(SAM_ACCOUNT *account_data, const struct passwd *pwd)
return NT_STATUS_OK;
}
-/******************************************************************
- * Get the free RID base if idmap is configured, otherwise return 0
- ******************************************************************/
-
-uint32 pdb_get_free_rid_base(void)
-{
- uint32 low, high;
- if (pdb_get_free_rid_range(&low, &high)) {
- return low;
- }
- return 0;
-}
-
-/******************************************************************
- * Get the the non-algorithmic RID range if idmap range are defined
- ******************************************************************/
-
-BOOL pdb_get_free_rid_range(uint32 *low, uint32 *high)
-{
- uid_t u_low, u_high;
- gid_t g_low, g_high;
- uint32 id_low, id_high;
-
- if (lp_idmap_only()) {
- *low = BASE_RID;
- *high = -1;
- }
-
- if (lp_idmap_uid(&u_low, &u_high) && lp_idmap_gid(&g_low, &g_high)) {
- if (u_low < g_low) {
- id_low = u_low;
- } else {
- id_low = g_low;
- }
- if (u_high > g_high) {
- id_high = u_high;
- } else {
- id_high = g_high;
- }
-
- *low = fallback_pdb_uid_to_user_rid(id_low);
- if (fallback_pdb_user_rid_to_uid(-1) < id_high) {
- *high = -1;
- } else {
- *high = fallback_pdb_uid_to_user_rid(id_high);
- }
-
- return True;
- }
-
- return False;
-}
-
/**********************************************************
Encode the account control bits into a string.
length = length of string to encode into (including terminating
diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c
index 2715c3e3ca..3ed5d2d4d6 100644
--- a/source3/passdb/pdb_tdb.c
+++ b/source3/passdb/pdb_tdb.c
@@ -754,7 +754,7 @@ static BOOL tdb_update_sam(struct pdb_methods *my_methods, SAM_ACCOUNT* newpwd,
if (!(user_rid = pdb_get_user_rid(newpwd))) {
if ((flag & TDB_INSERT) && tdb_state->permit_non_unix_accounts) {
uint32 lowrid, highrid;
- if (!pdb_get_free_rid_range(&lowrid, &highrid)) {
+ if (!idmap_get_free_rid_range(&lowrid, &highrid)) {
/* should never happen */
DEBUG(0, ("tdbsam: something messed up, no high/low rids but nua enabled ?!\n"));
ret = False;