summaryrefslogtreecommitdiff
path: root/server/nss/nsssrv_ldb.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-10-13 07:01:13 -0400
committerSimo Sorce <idra@samba.org>2008-10-13 07:01:13 -0400
commit56ae64b3f5116004a0023abdbd9163ba7c97c746 (patch)
tree9af8c937538588895f8bb5692640758ae06aca85 /server/nss/nsssrv_ldb.c
parent6389867a6038c8ae3b8bd1ea88726f3b650d067b (diff)
downloadsssd-56ae64b3f5116004a0023abdbd9163ba7c97c746.tar.gz
sssd-56ae64b3f5116004a0023abdbd9163ba7c97c746.tar.bz2
sssd-56ae64b3f5116004a0023abdbd9163ba7c97c746.zip
Implement getgrgid()
Diffstat (limited to 'server/nss/nsssrv_ldb.c')
-rw-r--r--server/nss/nsssrv_ldb.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/server/nss/nsssrv_ldb.c b/server/nss/nsssrv_ldb.c
index 04225e00..dce8d48b 100644
--- a/server/nss/nsssrv_ldb.c
+++ b/server/nss/nsssrv_ldb.c
@@ -364,6 +364,30 @@ int nss_ldb_getgrnam(TALLOC_CTX *mem_ctx,
return grp_search(sctx, ldb, expression);
}
+int nss_ldb_getgrgid(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ struct ldb_context *ldb,
+ uint64_t gid,
+ nss_ldb_callback_t fn, void *ptr)
+{
+ struct nss_ldb_search_ctx *sctx;
+ unsigned long long int filter_gid = gid;
+ char *expression;
+
+ sctx = init_sctx(mem_ctx, ldb, fn, ptr);
+ if (!sctx) {
+ return ENOMEM;
+ }
+
+ expression = talloc_asprintf(sctx, NSS_GRGID_FILTER, filter_gid);
+ if (!expression) {
+ talloc_free(sctx);
+ return ENOMEM;
+ }
+
+ return grp_search(sctx, ldb, expression);
+}
+
int nss_ldb_init(TALLOC_CTX *mem_ctx,
struct event_context *ev,