summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/winbind/wb_cmd_getgrgid.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/winbind/wb_cmd_getgrgid.c b/source4/winbind/wb_cmd_getgrgid.c
index fe946ed257..8ca93db38e 100644
--- a/source4/winbind/wb_cmd_getgrgid.c
+++ b/source4/winbind/wb_cmd_getgrgid.c
@@ -23,6 +23,7 @@
#include "libcli/composite/composite.h"
#include "winbind/wb_server.h"
#include "smbd/service_task.h"
+#include "param/param.h"
struct cmd_getgrgid_state {
struct composite_context *ctx;
@@ -127,6 +128,7 @@ static void cmd_getgrgid_recv_group_info(struct composite_context *ctx)
struct cmd_getgrgid_state);
struct libnet_GroupInfo *group_info;
struct winbindd_gr *gr;
+ char *group_name_with_domain;
DEBUG(5, ("cmd_getgrgid_recv_group_info called\n"));
@@ -139,7 +141,15 @@ static void cmd_getgrgid_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,
+ 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->gr_gid = state->gid;