summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-02-27 00:45:55 +0100
committerAndrew Bartlett <abartlet@samba.org>2013-02-27 14:01:59 +1100
commitecd0b10d2f1de986303f8aab2915c20c2f025244 (patch)
tree60e1a59b8b43d65812b4daf952e2cdc8d06e24f9 /source4
parent3e5acc155bb7be5c531a4a35b16e040f71f628ac (diff)
downloadsamba-ecd0b10d2f1de986303f8aab2915c20c2f025244.tar.gz
samba-ecd0b10d2f1de986303f8aab2915c20c2f025244.tar.bz2
samba-ecd0b10d2f1de986303f8aab2915c20c2f025244.zip
s4:winbindd: do not drop the workgroup name in the getgrnam and getgrent calls.
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/winbind/wb_cmd_getgrnam.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/winbind/wb_cmd_getgrnam.c b/source4/winbind/wb_cmd_getgrnam.c
index 7073209306..d75a460bd0 100644
--- a/source4/winbind/wb_cmd_getgrnam.c
+++ b/source4/winbind/wb_cmd_getgrnam.c
@@ -24,6 +24,7 @@
#include "winbind/wb_server.h"
#include "winbind/wb_helper.h"
#include "smbd/service_task.h"
+#include "param/param.h"
struct cmd_getgrnam_state {
struct composite_context *ctx;
@@ -105,6 +106,7 @@ static void cmd_getgrnam_recv_group_info(struct composite_context *ctx)
ctx->async.private_data, struct cmd_getgrnam_state);
struct libnet_GroupInfo *group_info;
struct winbindd_gr *gr;
+ char *group_name_with_domain;
DEBUG(5, ("cmd_getgrnam_recv_group_info called\n"));
@@ -117,7 +119,15 @@ static void cmd_getgrnam_recv_group_info(struct composite_context *ctx)
state->ctx->status = libnet_GroupInfo_recv(ctx, state, group_info);
if(!composite_is_ok(state->ctx)) return;
- WBSRV_SAMBA3_SET_STRING(gr->gr_name, group_info->out.group_name);
+ group_name_with_domain = talloc_asprintf(gr, "%s%s%s",
+ state->workgroup_name,
+ lpcfg_winbind_separator(state->service->task->lp_ctx),
+ group_info->out.group_name);
+ if (composite_nomem(group_name_with_domain, state->ctx)) {
+ return;
+ }
+
+ WBSRV_SAMBA3_SET_STRING(gr->gr_name, group_name_with_domain);
WBSRV_SAMBA3_SET_STRING(gr->gr_passwd, "*");
gr->num_gr_mem = group_info->out.num_members;
gr->gr_mem_ofs = 0;