No subject
Björn Jacke
bjacke at sernet.de
Fri May 17 03:06:36 MDT 2013
>From e8d96cc93347cae19e882ce42d85c35ca21ab83b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= <bj at sernet.de>
Date: Fri, 17 May 2013 10:38:20 +0200
Subject: [PATCH] winbind4: honor the settings of winbind enum users / groups
To: samba-technical at samba.org
fixes bug #9838
---
source3/param/loadparm_ctx.c | 2 ++
source4/winbind/wb_cmd_getgrent.c | 5 +++++
source4/winbind/wb_cmd_getpwent.c | 5 +++++
3 files changed, 12 insertions(+)
diff --git a/source3/param/loadparm_ctx.c b/source3/param/loadparm_ctx.c
index 63ead53..e84d67c 100644
--- a/source3/param/loadparm_ctx.c
+++ b/source3/param/loadparm_ctx.c
@@ -79,6 +79,8 @@ static const struct loadparm_s3_helpers s3_fns =
._domain_logons = lp__domain_logons,
.winbind_separator = lp_winbind_separator,
+ .winbind_enum_users = lp_winbind_enum_users,
+ .winbind_enum_groups = lp_winbind_enum_groups,
.template_homedir = lp_template_homedir,
.template_shell = lp_template_shell,
diff --git a/source4/winbind/wb_cmd_getgrent.c b/source4/winbind/wb_cmd_getgrent.c
index 79a3aff..29fd516 100644
--- a/source4/winbind/wb_cmd_getgrent.c
+++ b/source4/winbind/wb_cmd_getgrent.c
@@ -62,6 +62,11 @@ struct composite_context *wb_cmd_getgrent_send(TALLOC_CTX *mem_ctx,
state->max_groups = max_groups;
state->num_groups = 0;
+ if (!lpcfg_winbind_enum_groups(service->task->lp_ctx)) {
+ composite_error(state->ctx, NT_STATUS_NO_MORE_ENTRIES);
+ return result;
+ }
+
/* If there are groups left in the libnet_GroupList and we're below the
* maximum number of groups to get per winbind getgrent call, use
* getgrnam to get the winbindd_gr struct */
diff --git a/source4/winbind/wb_cmd_getpwent.c b/source4/winbind/wb_cmd_getpwent.c
index 45b9663..46ab2cb 100644
--- a/source4/winbind/wb_cmd_getpwent.c
+++ b/source4/winbind/wb_cmd_getpwent.c
@@ -62,6 +62,11 @@ struct composite_context *wb_cmd_getpwent_send(TALLOC_CTX *mem_ctx,
state->max_users = max_users;
state->num_users = 0;
+ if (!lpcfg_winbind_enum_users(service->task->lp_ctx)) {
+ composite_error(state->ctx, NT_STATUS_NO_MORE_ENTRIES);
+ return result;
+ }
+
/* If there are users left in the libnet_UserList and we're below the
* maximum number of users to get per winbind getpwent call, use
* getpwnam to get the winbindd_pw struct */
--
1.8.0
More information about the samba-technical
mailing list