make --anonymous only take realm.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24608 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -443,10 +443,8 @@ get_new_tickets(krb5_context context,
|
|||||||
krb5_get_init_creds_opt_set_forwardable (opt, forwardable_flag);
|
krb5_get_init_creds_opt_set_forwardable (opt, forwardable_flag);
|
||||||
if(proxiable_flag != -1)
|
if(proxiable_flag != -1)
|
||||||
krb5_get_init_creds_opt_set_proxiable (opt, proxiable_flag);
|
krb5_get_init_creds_opt_set_proxiable (opt, proxiable_flag);
|
||||||
if(anonymous_flag) {
|
if(anonymous_flag)
|
||||||
krb5_get_init_creds_opt_set_anonymous (opt, 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)
|
if (pac_flag != -1)
|
||||||
krb5_get_init_creds_opt_set_pac_request(context, opt,
|
krb5_get_init_creds_opt_set_pac_request(context, opt,
|
||||||
pac_flag ? TRUE : FALSE);
|
pac_flag ? TRUE : FALSE);
|
||||||
@@ -776,14 +774,30 @@ main (int argc, char **argv)
|
|||||||
if (canonicalize_flag || enterprise_flag)
|
if (canonicalize_flag || enterprise_flag)
|
||||||
parseflags |= KRB5_PRINCIPAL_PARSE_ENTERPRISE;
|
parseflags |= KRB5_PRINCIPAL_PARSE_ENTERPRISE;
|
||||||
|
|
||||||
if (argv[0]) {
|
if (anonymous_flag) {
|
||||||
ret = krb5_parse_name_flags (context, argv[0], parseflags, &principal);
|
krb5_realm realm = NULL;
|
||||||
|
|
||||||
|
if (argv[0])
|
||||||
|
realm = argv[0];
|
||||||
|
|
||||||
|
ret = krb5_make_principal(context, &principal, realm,
|
||||||
|
KRB5_WELLKNOWN_NAME, KRB5_ANON_NAME,
|
||||||
|
NULL);
|
||||||
if (ret)
|
if (ret)
|
||||||
krb5_err (context, 1, ret, "krb5_parse_name");
|
krb5_err(context, 1, ret, "krb5_build_principal");
|
||||||
|
krb5_principal_set_type(context, principal, KRB5_NT_WELLKNOWN);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ret = krb5_get_default_principal (context, &principal);
|
if (argv[0]) {
|
||||||
if (ret)
|
ret = krb5_parse_name_flags (context, argv[0], parseflags,
|
||||||
krb5_err (context, 1, ret, "krb5_get_default_principal");
|
&principal);
|
||||||
|
if (ret)
|
||||||
|
krb5_err (context, 1, ret, "krb5_parse_name");
|
||||||
|
} else {
|
||||||
|
ret = krb5_get_default_principal (context, &principal);
|
||||||
|
if (ret)
|
||||||
|
krb5_err (context, 1, ret, "krb5_get_default_principal");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fcache_version)
|
if(fcache_version)
|
||||||
|
Reference in New Issue
Block a user