summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-06-16 15:31:55 +0200
committerMichael Adam <obnox@samba.org>2010-08-14 02:10:43 +0200
commit834008c2cd55a87d4fada2390606381ec7316915 (patch)
tree29fdebeb9c4beb47ce65d53ee5e0ef6d4fe214d8 /source3
parent1dfb20d0292623f21f47e93afaba865d9ff3b05b (diff)
downloadsamba-834008c2cd55a87d4fada2390606381ec7316915.tar.gz
samba-834008c2cd55a87d4fada2390606381ec7316915.tar.bz2
samba-834008c2cd55a87d4fada2390606381ec7316915.zip
s3:idmap_tdb2: remove use of idmap_tdb2_state from idmap_tdb2_allocate_id
idmap_tdb2_state should actually be called idmap_tdb2_alloc_context. This is being removed as the idmap and allocation is moved together. We use the idmap_tdb2_context * that is sitting in dom->private_data. This contains the same ranges as those in the state anyways. Later, when we can also allocate for named domains, this will become necessary anyways.
Diffstat (limited to 'source3')
-rw-r--r--source3/winbindd/idmap_tdb2.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/winbindd/idmap_tdb2.c b/source3/winbindd/idmap_tdb2.c
index 0ea84c697e..1d02162a79 100644
--- a/source3/winbindd/idmap_tdb2.c
+++ b/source3/winbindd/idmap_tdb2.c
@@ -242,31 +242,33 @@ done:
return ret;
}
-static NTSTATUS idmap_tdb2_allocate_id(struct unixid *xid)
+static NTSTATUS idmap_tdb2_allocate_id(struct idmap_domain *dom,
+ struct unixid *xid)
{
const char *hwmkey;
const char *hwmtype;
uint32_t high_hwm;
uint32_t hwm = 0;
NTSTATUS status;
+ struct idmap_tdb2_context *ctx;
struct idmap_tdb2_allocate_id_context state;
status = idmap_tdb2_open_db();
NT_STATUS_NOT_OK_RETURN(status);
+ ctx = talloc_get_type(dom->private_data, struct idmap_tdb2_context);
+
/* Get current high water mark */
switch (xid->type) {
case ID_TYPE_UID:
hwmkey = HWM_USER;
hwmtype = "UID";
- high_hwm = idmap_tdb2_state.high_uid;
break;
case ID_TYPE_GID:
hwmkey = HWM_GROUP;
hwmtype = "GID";
- high_hwm = idmap_tdb2_state.high_gid;
break;
default:
@@ -274,6 +276,8 @@ static NTSTATUS idmap_tdb2_allocate_id(struct unixid *xid)
return NT_STATUS_INVALID_PARAMETER;
}
+ high_hwm = ctx->filter_high_id;
+
state.hwm = hwm;
state.high_hwm = high_hwm;
state.hwmtype = hwmtype;
@@ -311,7 +315,7 @@ static NTSTATUS idmap_tdb2_get_new_id(struct idmap_domain *dom,
return NT_STATUS_NOT_IMPLEMENTED;
}
- ret = idmap_tdb2_allocate_id(id);
+ ret = idmap_tdb2_allocate_id(dom, id);
return ret;
}