From: Ezra Peisach Date: Fri, 15 Mar 1996 19:18:24 +0000 (+0000) Subject: * ftpd.c (auth_data): Do not fail if last gss_service is not X-Git-Tag: krb5-1.0-beta6~360 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1e4a36c247e0d78f40335516d864f892ea47b661;p=krb5.git * ftpd.c (auth_data): Do not fail if last gss_service is not present in keytab. If no services present, return a useful minor error status. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7642 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/gssftp/ftpd/ChangeLog b/src/appl/gssftp/ftpd/ChangeLog index 1759aa776..f33fae7ae 100644 --- a/src/appl/gssftp/ftpd/ChangeLog +++ b/src/appl/gssftp/ftpd/ChangeLog @@ -1,3 +1,9 @@ +Fri Mar 15 14:16:41 1996 Ezra Peisach + + * ftpd.c (auth_data): Do not fail if last gss_service is not + present in keytab. If no services present, return a useful + minor error status. + Fri Mar 15 01:24:39 1996 Richard Basch * configure.in, ftpd.c: Added shadow password support. diff --git a/src/appl/gssftp/ftpd/ftpd.c b/src/appl/gssftp/ftpd/ftpd.c index 6f3e9cf06..51bcfc137 100644 --- a/src/appl/gssftp/ftpd/ftpd.c +++ b/src/appl/gssftp/ftpd/ftpd.c @@ -1899,13 +1899,14 @@ char *data; #ifdef GSSAPI if (strcmp(temp_auth_type, "GSSAPI") == 0) { int replied = 0; + int found = 0; gss_cred_id_t server_creds; gss_name_t client; int ret_flags; struct gss_channel_bindings_struct chan; gss_buffer_desc name_buf; gss_name_t server_name; - OM_uint32 maj_stat, min_stat; + OM_uint32 maj_stat, min_stat, save_stat; char localname[MAXHOSTNAMELEN]; char service_name[MAXHOSTNAMELEN+10]; char **service; @@ -1961,12 +1962,16 @@ char *data; maj_stat = gss_acquire_cred(&min_stat, server_name, 0, GSS_C_NULL_OID_SET, GSS_C_ACCEPT, &server_creds, NULL, NULL); + save_stat = min_stat; (void) gss_release_name(&min_stat, &server_name); if (maj_stat != GSS_S_COMPLETE) continue; + found++; } - if (maj_stat != GSS_S_COMPLETE) + + if (!found && (maj_stat != GSS_S_COMPLETE)) { + min_stat = save_stat; reply_gss_error(501, maj_stat, min_stat, "acquiring credentials"); syslog(LOG_ERR, "gssapi error acquiring credentials");