From: John Carr Date: Fri, 25 Sep 1992 03:09:52 +0000 (+0000) Subject: Principal type changes X-Git-Tag: krb5-1.0-beta2~51 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e9b7aaae9a55292a3e9f6e54533369f91c805193;p=krb5.git Principal type changes git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2411 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/popper/pop_pass.c b/src/appl/popper/pop_pass.c index 28e8de6f6..5c05acb03 100644 --- a/src/appl/popper/pop_pass.c +++ b/src/appl/popper/pop_pass.c @@ -32,6 +32,7 @@ extern AUTH_DAT kdata; #ifdef KRB5 #include #include +#include #include extern krb5_principal ext_client; extern char *client_name; @@ -54,6 +55,7 @@ POP * p; #endif /* KRB4 */ #ifdef KRB5 char *lrealm; + krb5_data *tmpdata; krb5_error_code retval; #endif /* KRB5 */ #else @@ -95,17 +97,17 @@ POP * p; "Kerberos error: \"%s\".", error_message(retval))); } - if (strncmp(ext_client[0]->data, lrealm, ext_client[0]->length)) { + tmpdata = krb5_princ_realm(ext_client); + if (strncmp(tmpdata->data, lrealm, tmpdata->length)) { pop_log(p, POP_WARNING, "%s: (%s) realm not accepted.", p->client, client_name); return(pop_msg(p,POP_FAILURE, "Kerberos realm \"%*s\" not accepted.", - ext_client[0]->length, ext_client[0]->data)); + tmpdata->length, tmpdata->data)); } - /* only accept one-component names, i.e. realm and name only */ - if (ext_client[2]) { + if (krb5_princ_size(ext_client) > 1) { pop_log(p, POP_WARNING, "%s: (%s) instance not accepted.", p->client, client_name); return(pop_msg(p,POP_FAILURE, @@ -119,13 +121,14 @@ POP * p; * but this causes too much confusion and assumes p->user will never * change. This makes me feel more comfortable. */ - if(strncmp(p->user, ext_client[1]->data, ext_client[1]->length)) + tmpdata = krb5_princ_component(ext_client, 0); + if(strncmp(p->user, tmpdata->data, tmpdata->length)) { pop_log(p, POP_WARNING, "%s: auth failed: %s vs %s", p->client, client_name, p->user); return(pop_msg(p,POP_FAILURE, - "Wrong username supplied (%*s vs. %s).\n", ext_client[1]->length, - ext_client[1]->data, + "Wrong username supplied (%*s vs. %s).\n", tmpdata->length, + tmpdata->data, p->user)); } #endif /* KRB5 */