* ftpd.c (auth_data): Do not fail if last gss_service is not
authorEzra Peisach <epeisach@mit.edu>
Fri, 15 Mar 1996 19:18:24 +0000 (19:18 +0000)
committerEzra Peisach <epeisach@mit.edu>
Fri, 15 Mar 1996 19:18:24 +0000 (19:18 +0000)
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

src/appl/gssftp/ftpd/ChangeLog
src/appl/gssftp/ftpd/ftpd.c

index 1759aa7765c826adf4fb6da0da6bf9f8c4315d27..f33fae7ae5b41d40fc0054bb414f573bc6cb55b5 100644 (file)
@@ -1,3 +1,9 @@
+Fri Mar 15 14:16:41 1996  Ezra Peisach  <epeisach@kangaroo.mit.edu>
+
+       * 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  <basch@lehman.com>
 
         * configure.in, ftpd.c: Added shadow password support.
index 6f3e9cf06bbe4fb1c03bb430b00649aafd0ddab5..51bcfc13750577875eac0877d27c23f5b22f8ac7 100644 (file)
@@ -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");