update from cygnus sources
authorMark Eichin <eichin@mit.edu>
Sat, 24 Feb 1996 02:20:22 +0000 (02:20 +0000)
committerMark Eichin <eichin@mit.edu>
Sat, 24 Feb 1996 02:20:22 +0000 (02:20 +0000)
Fri Feb 16 15:50:51 1996  Mark Eichin  <eichin@cygnus.com>

* ftp.c (do_auth): return status handling fixes from kbalk@hp.com.

Tue Jan 16 19:05:31 1996  Mark Eichin  <eichin@cygnus.com>

* ftp.c (login): move do_auth ...
* cmds.c (setpeer): ... to just before login call.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7511 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/gssftp/ftp/ChangeLog
src/appl/gssftp/ftp/cmds.c
src/appl/gssftp/ftp/ftp.c

index 0545222bbb78f52b7ce5f7b9c4c9f9fb990275d9..d330acc55e8d998a5a37e4c898216d6aa1ae366b 100644 (file)
@@ -1,3 +1,12 @@
+Fri Feb 16 15:50:51 1996  Mark Eichin  <eichin@cygnus.com>
+
+       * ftp.c (do_auth): return status handling fixes from kbalk@hp.com.
+
+Tue Jan 16 19:05:31 1996  Mark Eichin  <eichin@cygnus.com>
+
+       * ftp.c (login): move do_auth ...
+       * cmds.c (setpeer): ... to just before login call.
+
 Mon Feb 5 09:06:16 1996  Ezra Peisach  <epeisach@kangaroo.mit.edu>
 
        * configure.in: Check for stdlib.h
index 3687ceae01500452eb82353a7ef566c9e7e69593..c715723cbc8e72d423149ba323bbad92a393e16e 100644 (file)
@@ -167,6 +167,7 @@ setpeer(argc, argv)
                mode = MODE_S;
                stru = STRU_F;
                (void) strcpy(bytename, "8"), bytesize = 8;
+               do_auth();
                if (autologin)
                        (void) login(argv[1]);
 
index 341bb7e9e08ba2b71b420787746ab5bd8723f4bb..1734f0dd8135c34e0c3baa57f669e51c3e98cb55 100644 (file)
@@ -255,7 +255,6 @@ login(host)
        char *user, *pass, *acct, *getenv(), *getlogin(), *mygetpass();
        int n, aflag = 0;
 
-       do_auth();
        user = pass = acct = 0;
        if (ruserpass(host, &user, &pass, &acct) < 0) {
                code = -1;
@@ -592,25 +591,34 @@ getreply(expecteof)
                        return(getreply(expecteof));
                ibuf[0] = obuf[i] = '\0';
                if (code && n == '6')
-                   if (code != 631 && code != 632 && code != 633)
+                   if (code != 631 && code != 632 && code != 633) {
                        printf("Unknown reply: %d %s\n", code, obuf);
-                   else safe = code == 631;
+                       n = '5';
+                   } else safe = code;
                if (obuf[0])    /* if there is a string to decode */
-                   if (!auth_type)
+                   if (!auth_type) {
                        printf("Cannot decode reply:\n%d %s\n", code, obuf);
+                       n = '5';
+                   }
 #ifdef NOENCRYPTION
-                   else if (code == 632)
+                   else if (code == 632) {
                        printf("Cannot decrypt %d reply: %s\n", code, obuf);
+                       n = '5';
+                   }
 #endif
 #ifdef NOCONFIDENTIAL
-                   else if (code == 633)
+                   else if (code == 633) {
                        printf("Cannot decrypt %d reply: %s\n", code, obuf);
+                       n = '5';
+                   }
 #endif
                    else {
                        int len;
-                       if (kerror = radix_encode(obuf, ibuf, &len, 1))
+                       if (kerror = radix_encode(obuf, ibuf, &len, 1)) {
                            printf("Can't base 64 decode reply %d (%s)\n\"%s\"\n",
                                        code, radix_error(kerror), obuf);
+                           n = '5';
+                       }
 #ifdef KERBEROS
                        else if (strcmp(auth_type, "KERBEROS_V4") == 0)
                                if ((kerror = safe ?
@@ -620,12 +628,13 @@ getreply(expecteof)
                                : krb_rd_priv((unsigned char *)ibuf, len,
                                        schedule, &cred.session,
                                        &hisctladdr, &myctladdr, &msg_data))
-                               != KSUCCESS)
+                               != KSUCCESS) {
                                  printf("%d reply %s! (krb_rd_%s: %s)\n", code,
                                        safe ? "modified" : "garbled",
                                        safe ? "safe" : "priv",
                                        krb_get_err_text(kerror));
-                               else {
+                                 n = '5';
+                               } else {
                                  if (verbose) printf("%c:", safe ? 'S' : 'P');
                                  memcpy(ibuf, msg_data.app_data,
                                        msg_data.app_length);
@@ -648,6 +657,7 @@ getreply(expecteof)
                                if (maj_stat != GSS_S_COMPLETE) {
                                  user_gss_error(maj_stat, min_stat, 
                                                 "failed unsealing reply");
+                                 n = '5';
                                } else {
                                  memcpy(ibuf, msg_buf.value, 
                                         msg_buf.length);
@@ -1818,7 +1828,7 @@ char realm[REALM_SZ + 1];
 
 #ifdef GSSAPI
 /* for testing, we don't have an ftp key yet */
-char* gss_services[] = { /* "ftp",*/ "host", 0 };
+char* gss_services[] = { "ftp", "host", 0 };
 #endif /* GSSAPI */
 
 do_auth()
@@ -2016,6 +2026,8 @@ do_auth()
              }
            } while (maj_stat == GSS_S_CONTINUE_NEEDED);
     outer_loop:
+           if (maj_stat == GSS_S_COMPLETE)
+               break;
            ;
          }
          verbose = oldverbose;