libwbclient: duplicate primary group in returned sids array (was github PR #102)

Isaac Boukris iboukris at gmail.com
Thu Jan 17 01:34:05 UTC 2019


On Tue, Jan 15, 2019 at 2:58 PM Isaac Boukris <iboukris at gmail.com> wrote:
>
> See bugs:
> https://bugzilla.samba.org/show_bug.cgi?id=13136
> https://bugzilla.samba.org/show_bug.cgi?id=11362
>
> I managed to get Samba DC to respond correctly (that is, same as
> Windows) for both PAC and SamLogon requests, by refactoring the logic
> in authsam_make_user_info_dc() and adding the primary rid twice.. I
> only tested it very basically and it would need more work and tests,
> but I think it heads in the right direction, please take a look (once
> we sort this out, we can revisit the wbclient patch).

Actually, it would help if we land the wbclient fix together with the
DC one, in order to minimize the impact on consumers. Are there other
APIs that may need adjustment?

> WIP patch attached, pipeline at (running):
> https://gitlab.com/samba-team/devel/samba/pipelines/43412018

To my surprise, it didn't break any existing test :)
I'll try to add a new test that checks that the DC adds the primary
group to both places, and another one that wbclient ignores the second
reference, and post again.

Meanwhile, attaching again the little fix for incorrect check of
memory allocation I noticed while looking at this. Please review.
-------------- next part --------------
From cba5f8782902776ef7c5bebf8fb0aadec098a91a Mon Sep 17 00:00:00 2001
From: Isaac Boukris <iboukris at gmail.com>
Date: Tue, 15 Jan 2019 13:58:52 +0200
Subject: [PATCH] sam.c: fix incorrect check of talloc_new() allocation

Signed-off-by: Isaac Boukris <iboukris at gmail.com>
---
 source4/auth/sam.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source4/auth/sam.c b/source4/auth/sam.c
index 709e901b45b..6253ad0445c 100644
--- a/source4/auth/sam.c
+++ b/source4/auth/sam.c
@@ -364,7 +364,7 @@ _PUBLIC_ NTSTATUS authsam_make_user_info_dc(TALLOC_CTX *mem_ctx,
 	NT_STATUS_HAVE_NO_MEMORY(user_info_dc);
 
 	tmp_ctx = talloc_new(user_info_dc);
-	if (user_info_dc == NULL) {
+	if (tmp_ctx == NULL) {
 		TALLOC_FREE(user_info_dc);
 		return NT_STATUS_NO_MEMORY;
 	}
-- 
2.14.4



More information about the samba-technical mailing list