From 22016ebfeceb74b2ad76a039ca31397443a1156b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Wed, 4 Feb 2009 22:08:01 +0000 Subject: [PATCH] make anonymous work git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24601 ec53bebd-3082-4978-b11e-865c3cabbd6b --- kuser/kinit.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/kuser/kinit.c b/kuser/kinit.c index d0f3fde91..1f4c80f22 100644 --- a/kuser/kinit.c +++ b/kuser/kinit.c @@ -310,7 +310,7 @@ renew_validate(krb5_context context, else if (out) flags.b.proxiable = out->flags.b.proxiable; - if (anonymous_flag != -1) + if (anonymous_flag) flags.b.request_anonymous = anonymous_flag; if(life) in.times.endtime = time(NULL) + life; @@ -443,21 +443,24 @@ get_new_tickets(krb5_context context, krb5_get_init_creds_opt_set_forwardable (opt, forwardable_flag); if(proxiable_flag != -1) krb5_get_init_creds_opt_set_proxiable (opt, proxiable_flag); - if(anonymous_flag != -1) + if(anonymous_flag) { krb5_get_init_creds_opt_set_anonymous (opt, anonymous_flag); + krb5_principal_set_type(context, principal, KRB5_NT_WELLKNOWN); + } if (pac_flag != -1) krb5_get_init_creds_opt_set_pac_request(context, opt, pac_flag ? TRUE : FALSE); if (canonicalize_flag) krb5_get_init_creds_opt_set_canonicalize(context, opt, TRUE); - if (pk_user_id) { + if (pk_user_id || anonymous_flag) { ret = krb5_get_init_creds_opt_set_pkinit(context, opt, principal, pk_user_id, pk_x509_anchors, NULL, NULL, - pk_use_enckey ? 2 : 0, + pk_use_enckey ? 2 : 0 | + anonymous_flag ? 4 : 0, krb5_prompter_posix, NULL, passwd); @@ -525,7 +528,7 @@ get_new_tickets(krb5_context context, server_str, opt); krb5_kt_close(context, kt); - } else if (pk_user_id) { + } else if (pk_user_id || anonymous_flag) { ret = krb5_get_init_creds_password (context, &cred, principal,