Given better error message when user is not authoized to login.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@826 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1996-10-02 21:34:49 +00:00
parent 152a39366f
commit dba4b36c14

View File

@@ -302,9 +302,22 @@ kerberos4_is(ap, data, cnt)
if (UserNameRequested && !kuserok(&adat, UserNameRequested))
Data(ap, KRB_ACCEPT, (void *)0, 0);
else
Data(ap, KRB_REJECT,
(void *)"user is not authorized", -1);
else {
char *msg = malloc(ANAME_SZ + 1 + INST_SZ +
REALM_SZ +
strlen(UserNameRequested) + 80);
if (msg == NULL)
Data(ap, KRB_REJECT, (void *)0, 0);
sprintf (msg, "user `%s%s%s@%s' is not authorized "
"to login as `%s'", adat.pname,
*adat.pinst == '\0' ? "" : ".",
adat.pinst,
adat.prealm,
UserNameRequested);
Data(ap, KRB_REJECT, (void *)msg, -1);
free(msg);
}
auth_finished(ap, AUTH_USER);
break;