summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-05-30 21:40:44 +0200
committerMichael Adam <obnox@samba.org>2010-08-14 02:10:37 +0200
commit0d369271c5d7c466e2594a446a14977302850e2e (patch)
treedf4c5a906526a08bc3b0775e753a955143a96b4a /source3/winbindd
parent0d0032e744e394597d108def097143927637f854 (diff)
downloadsamba-0d369271c5d7c466e2594a446a14977302850e2e.tar.gz
samba-0d369271c5d7c466e2594a446a14977302850e2e.tar.bz2
samba-0d369271c5d7c466e2594a446a14977302850e2e.zip
s3:idmap: factor out common code of idmap_allocate_uid|gid()
into new idmap_allocate_unixid().
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/idmap.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c
index a0c083c248..aaccc0c8e4 100644
--- a/source3/winbindd/idmap.c
+++ b/source3/winbindd/idmap.c
@@ -620,7 +620,7 @@ fail:
idmap allocator interface functions
**************************************************************************/
-NTSTATUS idmap_allocate_uid(struct unixid *id)
+static NTSTATUS idmap_allocate_unixid(struct unixid *id)
{
struct idmap_alloc_context *ctx;
NTSTATUS ret;
@@ -629,21 +629,20 @@ NTSTATUS idmap_allocate_uid(struct unixid *id)
return ret;
}
- id->type = ID_TYPE_UID;
return ctx->methods->allocate_id(id);
}
-NTSTATUS idmap_allocate_gid(struct unixid *id)
-{
- struct idmap_alloc_context *ctx;
- NTSTATUS ret;
- if (!NT_STATUS_IS_OK(ret = idmap_alloc_init(&ctx))) {
- return ret;
- }
+NTSTATUS idmap_allocate_uid(struct unixid *id)
+{
+ id->type = ID_TYPE_UID;
+ return idmap_allocate_unixid(id);
+}
+NTSTATUS idmap_allocate_gid(struct unixid *id)
+{
id->type = ID_TYPE_GID;
- return ctx->methods->allocate_id(id);
+ return idmap_allocate_unixid(id);
}
NTSTATUS idmap_backends_unixid_to_sid(const char *domname, struct id_map *id)