[PATCH] The build with MIT KRB5 doesn't compile after process_prefork has been added

Andreas Schneider asn at samba.org
Fri Oct 20 07:00:42 UTC 2017


On Friday, 20 October 2017 02:21:41 CEST Andrew Bartlett wrote:
> On Thu, 2017-10-19 at 21:03 +0200, Andreas Schneider wrote:
> > On Thursday, 19 October 2017 20:57:40 CEST Andrew Bartlett wrote:
> > > On Thu, 2017-10-19 at 11:28 -0700, Jeremy Allison via samba-
> > > technical
> > > 
> > > 
> > > Sorry, I think this is wrong.  Sadly there are no automated tests
> > > for
> > > the MIT build as part of autobuild, and unless I'm reading the code
> > > wrong, this will just make the use of the kpasswd server fail in
> > > the
> > > MIT case as that pointer needs to be filled (as it is elsewhere) in
> > > instead of being set to NULL.
> > 
> > So it needs to be:
> > 
> > const struct model_ops *model_ops = process_model_startup("single");
> 
> No.  It needs to be like the rest of the code, using task->model_ops.
> 
> The line you have there is the one Gary removed when the overstamp
> pattern was changed.

The attached patchset fixes this and updates the test to work correctly with 
latest fixes.


Please review and push if possible.


Thanks,


	Andreas


-- 
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn at cryptomilk.org
-------------- next part --------------
>From cf28603601344ef3626d7727d7f821350c6a3c3e Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Thu, 19 Oct 2017 17:32:15 +0200
Subject: [PATCH 1/2] s4:kdc: Pass down the task to get access to model_ops for
 kpasswd server

Signed-off-by: Andreas Schneider <asn at samba.org>
---
 source4/kdc/kdc-service-mit.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/source4/kdc/kdc-service-mit.c b/source4/kdc/kdc-service-mit.c
index 53997d5473d..e5b20ffb523 100644
--- a/source4/kdc/kdc-service-mit.c
+++ b/source4/kdc/kdc-service-mit.c
@@ -58,7 +58,6 @@ static NTSTATUS startup_kpasswd_server(TALLOC_CTX *mem_ctx,
 				       struct loadparm_context *lp_ctx,
 				       struct interface *ifaces)
 {
-	const struct model_ops *model_ops;
 	int num_interfaces;
 	int i;
 	TALLOC_CTX *tmp_ctx;
@@ -92,7 +91,7 @@ static NTSTATUS startup_kpasswd_server(TALLOC_CTX *mem_ctx,
 
 		for (i = 0; wcard[i] != NULL; i++) {
 			status = kdc_add_socket(kdc,
-						model_ops,
+						kdc->task->model_ops,
 						"kpasswd",
 						wcard[i],
 						kpasswd_port,
@@ -116,7 +115,7 @@ static NTSTATUS startup_kpasswd_server(TALLOC_CTX *mem_ctx,
 		const char *address = talloc_strdup(tmp_ctx, iface_list_n_ip(ifaces, i));
 
 		status = kdc_add_socket(kdc,
-					model_ops,
+					kdc->task->model_ops,
 					"kpasswd",
 					address,
 					kpasswd_port,
-- 
2.14.2


>From 8a64799f3e7ee201d7f4f312dd1ee432b427ee3b Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Fri, 20 Oct 2017 08:58:21 +0200
Subject: [PATCH 2/2] testprogs: Change the set password test

This has been fixed with b81ca4f9dcbb378a95fb3ac31bfd9a1cbe505d7d

Signed-off-by: Andreas Schneider <asn at samba.org>
---
 testprogs/blackbox/test_kpasswd_mit.sh | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/testprogs/blackbox/test_kpasswd_mit.sh b/testprogs/blackbox/test_kpasswd_mit.sh
index 8a0bce449f3..d08367ff6ab 100755
--- a/testprogs/blackbox/test_kpasswd_mit.sh
+++ b/testprogs/blackbox/test_kpasswd_mit.sh
@@ -192,11 +192,8 @@ test_smbclient "Test login with user kerberos" \
 ### Test kpasswd service via 'net ads password'
 ###########################################################
 
-# NOTE: This call works if it is compiled with Heimdal, because the Heimdal
-# krb5_set_password() implementation falls back to change_password. The MIT
-# function doesn't!
-testit_expect_failure "change user password with 'net ads password', admin: $DOMAIN/$TEST_USERNAME, target: $TEST_PRINCIPAL (will fail)" \
-	$VALGRIND $net_tool ads password -W$DOMAIN -U$TEST_PRINCIPAL%$TEST_PASSWORD $TEST_PRINCIPAL "$TEST_PASSWORD_NEW" && failed=`expr $failed + 1`
+testit "change user password with 'net ads password', admin: $DOMAIN/$TEST_USERNAME, target: $TEST_PRINCIPAL" \
+	$VALGRIND $net_tool ads password -W$DOMAIN -U$TEST_PRINCIPAL%$TEST_PASSWORD $TEST_PRINCIPAL "$TEST_PASSWORD_NEW" || failed=`expr $failed + 1`
 
 #TEST_PASSWORD=$TEST_PASSWORD_NEW
 #TEST_PASSWORD_NEW="testPaSS at 06%"
-- 
2.14.2



More information about the samba-technical mailing list