From 0d369271c5d7c466e2594a446a14977302850e2e Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sun, 30 May 2010 21:40:44 +0200 Subject: s3:idmap: factor out common code of idmap_allocate_uid|gid() into new idmap_allocate_unixid(). --- source3/winbindd/idmap.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'source3') 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) -- cgit