summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-04-12 04:01:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:49:59 -0500
commitb60157ffd21aaeed01ffefee0e33493b278556d6 (patch)
treefdc3f0f0bda0db933d37db826bf85ab105f0c3a2
parent3154dbd3acfa91e2a804cb721489ee4dae020c83 (diff)
downloadsamba-b60157ffd21aaeed01ffefee0e33493b278556d6.tar.gz
samba-b60157ffd21aaeed01ffefee0e33493b278556d6.tar.bz2
samba-b60157ffd21aaeed01ffefee0e33493b278556d6.zip
r22184: On some hosts, parsing a compleatly invalid principal causes heimadal
to try and figure out what realm the current host is in (by DNS lookup for it's full domain name). We don't want to do that for this test, just break the checksum. Andrew Bartlett (This used to be commit 791e87514505acc68c5a8ff71fe9a27efdc6a027)
-rw-r--r--source4/torture/auth/pac.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/torture/auth/pac.c b/source4/torture/auth/pac.c
index d3d6dcbe4d..d23a9c1b5a 100644
--- a/source4/torture/auth/pac.c
+++ b/source4/torture/auth/pac.c
@@ -276,6 +276,7 @@ static bool torture_pac_saved_check(struct torture_context *tctx)
struct smb_krb5_context *smb_krb5_context;
const char *principal_string;
+ char *broken_principal_string;
krb5_principal client_principal;
const char *authtime_string;
time_t authtime;
@@ -575,8 +576,11 @@ static bool torture_pac_saved_check(struct torture_context *tctx)
/* Break the client principal */
krb5_free_principal(smb_krb5_context->krb5_context, client_principal);
+ broken_principal_string = talloc_strdup(mem_ctx, principal_string);
+ broken_principal_string[0]++;
+
ret = krb5_parse_name(smb_krb5_context->krb5_context,
- "not the right principal", &client_principal);
+ broken_principal_string, &client_principal);
if (ret) {
krb5_free_keyblock_contents(smb_krb5_context->krb5_context,
@@ -584,7 +588,7 @@ static bool torture_pac_saved_check(struct torture_context *tctx)
krb5_free_keyblock_contents(smb_krb5_context->krb5_context,
&server_keyblock);
torture_fail(tctx, talloc_asprintf(tctx,
- "(saved test) parsing of bogus client principal failed: %s",
+ "(saved test) parsing of broken client principal failed: %s",
smb_get_krb5_error_message(smb_krb5_context->krb5_context, ret, mem_ctx)));
}