[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Tue Jul 14 17:16:03 UTC 2015


The branch, master has been updated
       via  ff3b446 s4-torture: use smb_krb5_principal_set_type() in lsa forest krb5 tests.
       via  a1c9415 s4-torture: use krb5_error in lsa forest trust tests.
       via  da3f412 s4-torture: use smb_krb5_free_error() in lsa forest krb5 tests.
       via  4eda808 lib/krb5: add new KRB5_ERROR_CODE() abstraction macro.
       via  54ec74b s4-torture: use smb_krb5_principal_get_type in lsa forest krb5 tests.
       via  4e69ff6 s4-torture: use smb_krb5_make_principal() in lsa forest krb5 tests.
      from  5147ff5 s3: tests: Add blackbox test for scopy.

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit ff3b446175aa5dfb704698845ebf8341796f76e2
Author: Günther Deschner <gd at samba.org>
Date:   Thu Jul 9 18:05:12 2015 +0200

    s4-torture: use smb_krb5_principal_set_type() in lsa forest krb5 tests.
    
    Guenther
    
    Signed-off-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Tue Jul 14 19:15:59 CEST 2015 on sn-devel-104

commit a1c9415769b8a8b9cf3e8b88a13bfa2301ea8863
Author: Günther Deschner <gd at samba.org>
Date:   Thu Jul 9 18:02:31 2015 +0200

    s4-torture: use krb5_error in lsa forest trust tests.
    
    Guenther
    
    Signed-off-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit da3f41219d564c8166a680fcce83d88e2a0e160b
Author: Günther Deschner <gd at samba.org>
Date:   Thu Jul 9 18:01:34 2015 +0200

    s4-torture: use smb_krb5_free_error() in lsa forest krb5 tests.
    
    Guenther
    
    Signed-off-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 4eda808a5784b1bf6b26bdeb557cf1caf56be60c
Author: Günther Deschner <gd at samba.org>
Date:   Thu Jul 9 18:00:49 2015 +0200

    lib/krb5: add new KRB5_ERROR_CODE() abstraction macro.
    
    Guenther
    
    Signed-off-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 54ec74b3b25383cf96b658e7f18cd032af8c370f
Author: Günther Deschner <gd at samba.org>
Date:   Thu Jul 9 18:00:13 2015 +0200

    s4-torture: use smb_krb5_principal_get_type in lsa forest krb5 tests.
    
    Guenther
    
    Signed-off-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 4e69ff6bdde9e8117f6a654a850787f329a1610d
Author: Günther Deschner <gd at samba.org>
Date:   Thu Jul 9 17:59:28 2015 +0200

    s4-torture: use smb_krb5_make_principal() in lsa forest krb5 tests.
    
    Guenther
    
    Signed-off-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/krb5_wrap/krb5_samba.h |   6 ++
 source4/torture/rpc/lsa.c  | 177 +++++++++++++++++++++++----------------------
 2 files changed, 95 insertions(+), 88 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/krb5_wrap/krb5_samba.h b/lib/krb5_wrap/krb5_samba.h
index 12711e8..cef9144 100644
--- a/lib/krb5_wrap/krb5_samba.h
+++ b/lib/krb5_wrap/krb5_samba.h
@@ -109,6 +109,12 @@ typedef struct {
 #define KRB5_KEY_DATA_CAST	krb5_octet
 #endif /* HAVE_KRB5_KEYBLOCK_KEYVALUE */
 
+#ifdef HAVE_E_DATA_POINTER_IN_KRB5_ERROR /* Heimdal */
+#define KRB5_ERROR_CODE(k)	((k)->error_code)
+#else /* MIT */
+#define KRB5_ERROR_CODE(k)	((k)->error)
+#endif /* HAVE_E_DATA_POINTER_IN_KRB5_ERROR */
+
 krb5_error_code smb_krb5_parse_name(krb5_context context,
 				const char *name, /* in unix charset */
                                 krb5_principal *principal);
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c
index 0eda0a1..95caebb 100644
--- a/source4/torture/rpc/lsa.c
+++ b/source4/torture/rpc/lsa.c
@@ -2926,7 +2926,7 @@ struct check_pw_with_krb5_ctx {
 		unsigned error_io;
 		unsigned ok;
 	} counts;
-	KRB_ERROR error;
+	krb5_error error;
 	struct smb_krb5_context *smb_krb5_context;
 	krb5_get_init_creds_opt *krb_options;
 	krb5_creds my_creds;
@@ -2974,8 +2974,8 @@ static krb5_error_code check_pw_with_krb5_send_and_recv_func(krb5_context contex
 
 	hi.proto = KRB5_KRBHST_TCP;
 
-	free_KRB_ERROR(&ctx->error);
-
+	smb_krb5_free_error(ctx->smb_krb5_context->krb5_context,
+			    &ctx->error);
 	ctx->counts.io++;
 
 	k5ret = smb_krb5_send_and_recv_func_forced(context, ctx->server,
@@ -3155,7 +3155,8 @@ static int check_pw_with_krb5_ctx_destructor(struct check_pw_with_krb5_ctx *ctx)
 
 	free_EncTicketPart(&ctx->krbtgt_referral_enc_part);
 
-	free_KRB_ERROR(&ctx->error);
+	smb_krb5_free_error(ctx->smb_krb5_context->krb5_context,
+			    &ctx->error);
 
 	talloc_unlink(ctx, ctx->smb_krb5_context);
 	ctx->smb_krb5_context = NULL;
@@ -3237,32 +3238,32 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 	upn_realm_string = talloc_asprintf(ctx, "user@%s",
 					   trusted_realm_name);
 	torture_assert_int_equal(tctx,
-			krb5_make_principal(ctx->smb_krb5_context->krb5_context,
-					    &ctx->upn_realm,
-					    realm, upn_realm_string, NULL),
-			0, "krb5_make_principal failed");
-	krb5_principal_set_type(ctx->smb_krb5_context->krb5_context,
-				ctx->upn_realm, KRB5_NT_ENTERPRISE_PRINCIPAL);
+			smb_krb5_make_principal(ctx->smb_krb5_context->krb5_context,
+						&ctx->upn_realm,
+						realm, upn_realm_string, NULL),
+			0, "smb_krb5_make_principal failed");
+	smb_krb5_principal_set_type(ctx->smb_krb5_context->krb5_context,
+				    ctx->upn_realm, KRB5_NT_ENTERPRISE_PRINCIPAL);
 
 	upn_dns_string = talloc_asprintf(ctx, "user@%s",
 					 trusted_dns_name);
 	torture_assert_int_equal(tctx,
-			krb5_make_principal(ctx->smb_krb5_context->krb5_context,
-					    &ctx->upn_dns,
-					    realm, upn_dns_string, NULL),
-			0, "krb5_make_principal failed");
-	krb5_principal_set_type(ctx->smb_krb5_context->krb5_context,
-				ctx->upn_dns, KRB5_NT_ENTERPRISE_PRINCIPAL);
+			smb_krb5_make_principal(ctx->smb_krb5_context->krb5_context,
+						&ctx->upn_dns,
+						realm, upn_dns_string, NULL),
+			0, "smb_krb5_make_principal failed");
+	smb_krb5_principal_set_type(ctx->smb_krb5_context->krb5_context,
+				    ctx->upn_dns, KRB5_NT_ENTERPRISE_PRINCIPAL);
 
 	upn_netbios_string = talloc_asprintf(ctx, "user@%s",
 					 trusted_netbios_name);
 	torture_assert_int_equal(tctx,
-			krb5_make_principal(ctx->smb_krb5_context->krb5_context,
-					    &ctx->upn_netbios,
-					    realm, upn_netbios_string, NULL),
-			0, "krb5_make_principal failed");
-	krb5_principal_set_type(ctx->smb_krb5_context->krb5_context,
-				ctx->upn_netbios, KRB5_NT_ENTERPRISE_PRINCIPAL);
+			smb_krb5_make_principal(ctx->smb_krb5_context->krb5_context,
+						&ctx->upn_netbios,
+						realm, upn_netbios_string, NULL),
+			0, "smb_krb5_make_principal failed");
+	smb_krb5_principal_set_type(ctx->smb_krb5_context->krb5_context,
+				    ctx->upn_netbios, KRB5_NT_ENTERPRISE_PRINCIPAL);
 
 	k5ret = principal_from_credentials(ctx, credentials, ctx->smb_krb5_context,
 					   &principal, &obtained,  &error_string);
@@ -3287,7 +3288,7 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 	torture_assert_int_equal(tctx, k5ret, KRB5_KDC_UNREACH, assertion_message);
 	torture_assert_int_equal(tctx, ctx->counts.io, 1, assertion_message);
 	torture_assert_int_equal(tctx, ctx->counts.error_io, 1, assertion_message);
-	torture_assert_int_equal(tctx, ctx->error.error_code, 68, assertion_message);
+	torture_assert_int_equal(tctx, KRB5_ERROR_CODE(&ctx->error), 68, assertion_message);
 	torture_assert(tctx, ctx->error.crealm != NULL, assertion_message);
 	torture_assert_str_equal(tctx, *ctx->error.crealm, trusted_realm_name, assertion_message);
 	torture_assert(tctx, ctx->error.cname == NULL, assertion_message);
@@ -3312,7 +3313,7 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 	torture_assert_int_equal(tctx, k5ret, KRB5_KDC_UNREACH, assertion_message);
 	torture_assert_int_equal(tctx, ctx->counts.io, 1, assertion_message);
 	torture_assert_int_equal(tctx, ctx->counts.error_io, 1, assertion_message);
-	torture_assert_int_equal(tctx, ctx->error.error_code, 68, assertion_message);
+	torture_assert_int_equal(tctx, KRB5_ERROR_CODE(&ctx->error), 68, assertion_message);
 	torture_assert(tctx, ctx->error.crealm != NULL, assertion_message);
 	torture_assert_str_equal(tctx, *ctx->error.crealm, trusted_realm_name, assertion_message);
 	torture_assert(tctx, ctx->error.cname == NULL, assertion_message);
@@ -3337,7 +3338,7 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 	torture_assert_int_equal(tctx, k5ret, KRB5_KDC_UNREACH, assertion_message);
 	torture_assert_int_equal(tctx, ctx->counts.io, 1, assertion_message);
 	torture_assert_int_equal(tctx, ctx->counts.error_io, 1, assertion_message);
-	torture_assert_int_equal(tctx, ctx->error.error_code, 68, assertion_message);
+	torture_assert_int_equal(tctx, KRB5_ERROR_CODE(&ctx->error), 68, assertion_message);
 	torture_assert(tctx, ctx->error.crealm != NULL, assertion_message);
 	torture_assert_str_equal(tctx, *ctx->error.crealm, trusted_realm_name, assertion_message);
 	torture_assert(tctx, ctx->error.cname == NULL, assertion_message);
@@ -3413,29 +3414,29 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 	krbtgt_trust_realm_string = talloc_asprintf(ctx, "krbtgt/%s@%s",
 						    trusted_realm_name, realm);
 	torture_assert_int_equal(tctx,
-			krb5_make_principal(ctx->smb_krb5_context->krb5_context,
-					    &ctx->krbtgt_trust_realm,
-					    realm, "krbtgt",
-					    trusted_realm_name, NULL),
-			0, "krb5_make_principal failed");
+			smb_krb5_make_principal(ctx->smb_krb5_context->krb5_context,
+						&ctx->krbtgt_trust_realm,
+						realm, "krbtgt",
+						trusted_realm_name, NULL),
+			0, "smb_krb5_make_principal failed");
 
 	krbtgt_trust_dns_string = talloc_asprintf(ctx, "krbtgt/%s@%s",
 						  trusted_dns_name, realm);
 	torture_assert_int_equal(tctx,
-			krb5_make_principal(ctx->smb_krb5_context->krb5_context,
-					    &ctx->krbtgt_trust_dns,
-					    realm, "krbtgt",
-					    trusted_dns_name, NULL),
-			0, "krb5_make_principal failed");
+			smb_krb5_make_principal(ctx->smb_krb5_context->krb5_context,
+						&ctx->krbtgt_trust_dns,
+						realm, "krbtgt",
+						trusted_dns_name, NULL),
+			0, "smb_krb5_make_principal failed");
 
 	krbtgt_trust_netbios_string = talloc_asprintf(ctx, "krbtgt/%s@%s",
 						      trusted_netbios_name, realm);
 	torture_assert_int_equal(tctx,
-			krb5_make_principal(ctx->smb_krb5_context->krb5_context,
-					    &ctx->krbtgt_trust_netbios,
-					    realm, "krbtgt",
-					    trusted_netbios_name, NULL),
-			0, "krb5_make_principal failed");
+			smb_krb5_make_principal(ctx->smb_krb5_context->krb5_context,
+						&ctx->krbtgt_trust_netbios,
+						realm, "krbtgt",
+						trusted_netbios_name, NULL),
+			0, "smb_krb5_make_principal failed");
 
 	/* Confirm if we can do a TGS for krbtgt/trusted_realm */
 	ZERO_STRUCT(ctx->counts);
@@ -3463,8 +3464,8 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 				      ctx->krbtgt_trust_realm_creds->server,
 				      ctx->krbtgt_trust_realm);
 	torture_assert(tctx, k5ok, assertion_message);
-	type = krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
-				       ctx->krbtgt_trust_realm_creds->server);
+	type = smb_krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
+					   ctx->krbtgt_trust_realm_creds->server);
 	torture_assert_int_equal(tctx, type, KRB5_NT_SRV_INST, assertion_message);
 
 	/* Confirm if we have no referral ticket in the cache */
@@ -3525,8 +3526,8 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 				      ctx->krbtgt_referral_creds.server,
 				      ctx->krbtgt_trust_realm);
 	torture_assert(tctx, k5ok, assertion_message);
-	type = krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
-				       ctx->krbtgt_referral_creds.server);
+	type = smb_krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
+					   ctx->krbtgt_referral_creds.server);
 	torture_assert_int_equal(tctx, type, KRB5_NT_SRV_INST, assertion_message);
 	k5ret = decode_Ticket(ctx->krbtgt_referral_creds.ticket.data,
 			      ctx->krbtgt_referral_creds.ticket.length,
@@ -3615,8 +3616,8 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 				      ctx->krbtgt_trust_dns_creds->server,
 				      ctx->krbtgt_trust_realm);
 	torture_assert(tctx, k5ok, assertion_message);
-	type = krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
-				       ctx->krbtgt_trust_dns_creds->server);
+	type = smb_krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
+					   ctx->krbtgt_trust_dns_creds->server);
 	torture_assert_int_equal(tctx, type, KRB5_NT_SRV_INST, assertion_message);
 
 	/* Confirm if we have the referral ticket in the cache */
@@ -3639,8 +3640,8 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 				      ctx->krbtgt_referral_creds.server,
 				      ctx->krbtgt_trust_realm);
 	torture_assert(tctx, k5ok, assertion_message);
-	type = krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
-				       ctx->krbtgt_referral_creds.server);
+	type = smb_krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
+					   ctx->krbtgt_referral_creds.server);
 	torture_assert_int_equal(tctx, type, KRB5_NT_SRV_INST, assertion_message);
 
 	/* Delete the referral ticket from the cache */
@@ -3698,8 +3699,8 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 				      ctx->krbtgt_referral_creds.server,
 				      ctx->krbtgt_trust_realm);
 	torture_assert(tctx, k5ok, assertion_message);
-	type = krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
-				       ctx->krbtgt_referral_creds.server);
+	type = smb_krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
+					   ctx->krbtgt_referral_creds.server);
 	torture_assert_int_equal(tctx, type, KRB5_NT_SRV_INST, assertion_message);
 
 	/* Delete the referral ticket from the cache */
@@ -3741,8 +3742,8 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 				      ctx->krbtgt_trust_netbios_creds->server,
 				      ctx->krbtgt_trust_realm);
 	torture_assert(tctx, k5ok, assertion_message);
-	type = krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
-				       ctx->krbtgt_trust_netbios_creds->server);
+	type = smb_krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
+					   ctx->krbtgt_trust_netbios_creds->server);
 	torture_assert_int_equal(tctx, type, KRB5_NT_SRV_INST, assertion_message);
 
 	/* Confirm if we have the referral ticket in the cache */
@@ -3765,8 +3766,8 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 				      ctx->krbtgt_referral_creds.server,
 				      ctx->krbtgt_trust_realm);
 	torture_assert(tctx, k5ok, assertion_message);
-	type = krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
-				       ctx->krbtgt_referral_creds.server);
+	type = smb_krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
+					   ctx->krbtgt_referral_creds.server);
 	torture_assert_int_equal(tctx, type, KRB5_NT_SRV_INST, assertion_message);
 
 	/* Delete the referral ticket from the cache */
@@ -3785,11 +3786,11 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 	cifs_trust_dns_string = talloc_asprintf(ctx, "cifs/%s@%s",
 						trusted_dns_name, realm);
 	torture_assert_int_equal(tctx,
-			krb5_make_principal(ctx->smb_krb5_context->krb5_context,
-					    &ctx->cifs_trust_dns,
-					    realm, "cifs",
-					    trusted_dns_name, NULL),
-			0, "krb5_make_principal failed");
+			smb_krb5_make_principal(ctx->smb_krb5_context->krb5_context,
+						&ctx->cifs_trust_dns,
+						realm, "cifs",
+						trusted_dns_name, NULL),
+			0, "smb_krb5_make_principal failed");
 
 	/* Confirm if we get krbtgt/trusted_realm back when asking for cifs/trusted_realm */
 	ZERO_STRUCT(ctx->counts);
@@ -3832,8 +3833,8 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 				      ctx->krbtgt_referral_creds.server,
 				      ctx->krbtgt_trust_realm);
 	torture_assert(tctx, k5ok, assertion_message);
-	type = krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
-				       ctx->krbtgt_referral_creds.server);
+	type = smb_krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
+					   ctx->krbtgt_referral_creds.server);
 	torture_assert_int_equal(tctx, type, KRB5_NT_SRV_INST, assertion_message);
 
 	/* Delete the referral ticket from the cache */
@@ -3852,11 +3853,11 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 	cifs_trust_netbios_string = talloc_asprintf(ctx, "cifs/%s@%s",
 						trusted_netbios_name, realm);
 	torture_assert_int_equal(tctx,
-			krb5_make_principal(ctx->smb_krb5_context->krb5_context,
-					    &ctx->cifs_trust_netbios,
-					    realm, "cifs",
-					    trusted_netbios_name, NULL),
-			0, "krb5_make_principal failed");
+			smb_krb5_make_principal(ctx->smb_krb5_context->krb5_context,
+						&ctx->cifs_trust_netbios,
+						realm, "cifs",
+						trusted_netbios_name, NULL),
+			0, "smb_krb5_make_principal failed");
 
 	/* Confirm if we get krbtgt/trusted_realm back when asking for cifs/trusted_realm */
 	ZERO_STRUCT(ctx->counts);
@@ -3899,8 +3900,8 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 				      ctx->krbtgt_referral_creds.server,
 				      ctx->krbtgt_trust_realm);
 	torture_assert(tctx, k5ok, assertion_message);
-	type = krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
-				       ctx->krbtgt_referral_creds.server);
+	type = smb_krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
+					   ctx->krbtgt_referral_creds.server);
 	torture_assert_int_equal(tctx, type, KRB5_NT_SRV_INST, assertion_message);
 
 	/* Delete the referral ticket from the cache */
@@ -3920,11 +3921,11 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 			"E3514235-4B06-11D1-AB04-00C04FC2DCD2/%s/%s@%s",
 			workstation, trusted_dns_name, realm);
 	torture_assert_int_equal(tctx,
-			krb5_make_principal(ctx->smb_krb5_context->krb5_context,
-					    &ctx->drs_trust_dns,
-					    realm, "E3514235-4B06-11D1-AB04-00C04FC2DCD2",
-					    workstation, trusted_dns_name, NULL),
-			0, "krb5_make_principal failed");
+			smb_krb5_make_principal(ctx->smb_krb5_context->krb5_context,
+						&ctx->drs_trust_dns,
+						realm, "E3514235-4B06-11D1-AB04-00C04FC2DCD2",
+						workstation, trusted_dns_name, NULL),
+			0, "smb_krb5_make_principal failed");
 
 	/* Confirm if we get krbtgt/trusted_realm back when asking for a 3 part principal */
 	ZERO_STRUCT(ctx->counts);
@@ -3967,8 +3968,8 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 				      ctx->krbtgt_referral_creds.server,
 				      ctx->krbtgt_trust_realm);
 	torture_assert(tctx, k5ok, assertion_message);
-	type = krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
-				       ctx->krbtgt_referral_creds.server);
+	type = smb_krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
+					   ctx->krbtgt_referral_creds.server);
 	torture_assert_int_equal(tctx, type, KRB5_NT_SRV_INST, assertion_message);
 
 	/* Delete the referral ticket from the cache */
@@ -3988,11 +3989,11 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 			"E3514235-4B06-11D1-AB04-00C04FC2DCD2/%s/%s@%s",
 			workstation, trusted_netbios_name, realm);
 	torture_assert_int_equal(tctx,
-			krb5_make_principal(ctx->smb_krb5_context->krb5_context,
-					    &ctx->drs_trust_netbios,
-					    realm, "E3514235-4B06-11D1-AB04-00C04FC2DCD2",
-					    workstation, trusted_netbios_name, NULL),
-			0, "krb5_make_principal failed");
+			smb_krb5_make_principal(ctx->smb_krb5_context->krb5_context,
+						&ctx->drs_trust_netbios,
+						realm, "E3514235-4B06-11D1-AB04-00C04FC2DCD2",
+						workstation, trusted_netbios_name, NULL),
+			0, "smb_krb5_make_principal failed");
 
 	/* Confirm if we get krbtgt/trusted_realm back when asking for a 3 part principal */
 	ZERO_STRUCT(ctx->counts);
@@ -4035,8 +4036,8 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 				      ctx->krbtgt_referral_creds.server,
 				      ctx->krbtgt_trust_realm);
 	torture_assert(tctx, k5ok, assertion_message);
-	type = krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
-				       ctx->krbtgt_referral_creds.server);
+	type = smb_krb5_principal_get_type(ctx->smb_krb5_context->krb5_context,
+					   ctx->krbtgt_referral_creds.server);
 	torture_assert_int_equal(tctx, type, KRB5_NT_SRV_INST, assertion_message);
 
 	/* Delete the referral ticket from the cache */
@@ -4055,11 +4056,11 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 	four_trust_dns_string = talloc_asprintf(ctx, "four/tree/two/%s@%s",
 						trusted_dns_name, realm);
 	torture_assert_int_equal(tctx,
-			krb5_make_principal(ctx->smb_krb5_context->krb5_context,
-					    &ctx->four_trust_dns,
-					    realm, "four", "tree", "two",
-					    trusted_dns_name, NULL),
-			0, "krb5_make_principal failed");
+			smb_krb5_make_principal(ctx->smb_krb5_context->krb5_context,
+						&ctx->four_trust_dns,
+						realm, "four", "tree", "two",
+						trusted_dns_name, NULL),
+			0, "smb_krb5_make_principal failed");
 
 	/* Confirm if we get an error back for a 4 part principal */
 	ZERO_STRUCT(ctx->counts);
@@ -4081,7 +4082,7 @@ static bool check_pw_with_krb5(struct torture_context *tctx,
 	torture_assert_int_equal(tctx, k5ret, KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN, assertion_message);
 	torture_assert_int_equal(tctx, ctx->counts.io, 1, assertion_message);
 	torture_assert_int_equal(tctx, ctx->counts.error_io, 1, assertion_message);
-	torture_assert_int_equal(tctx, ctx->error.error_code, 7, assertion_message);
+	torture_assert_int_equal(tctx, KRB5_ERROR_CODE(&ctx->error), 7, assertion_message);
 
 	/* Confirm if we have no referral ticket in the cache */
 	krb5_free_cred_contents(ctx->smb_krb5_context->krb5_context,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list