diff options
Diffstat (limited to 'crypto/kerberosIV/appl/ftp/ftp/kauth.c')
-rw-r--r-- | crypto/kerberosIV/appl/ftp/ftp/kauth.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/crypto/kerberosIV/appl/ftp/ftp/kauth.c b/crypto/kerberosIV/appl/ftp/ftp/kauth.c index 434dfb8..613593a 100644 --- a/crypto/kerberosIV/appl/ftp/ftp/kauth.c +++ b/crypto/kerberosIV/appl/ftp/ftp/kauth.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan + * Copyright (c) 1995-1999 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -14,12 +14,7 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the Kungliga Tekniska - * Högskolan and its contributors. - * - * 4. Neither the name of the Institute nor the names of its contributors + * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -38,7 +33,7 @@ #include "ftp_locl.h" #include <krb.h> -RCSID("$Id: kauth.c,v 1.17 1998/03/26 02:55:38 joda Exp $"); +RCSID("$Id: kauth.c,v 1.20 1999/12/02 16:58:29 joda Exp $"); void kauth(int argc, char **argv) @@ -54,6 +49,8 @@ kauth(int argc, char **argv) char passwd[100]; int tmp; + int save; + if(argc > 2){ printf("usage: %s [principal]\n", argv[0]); code = -1; @@ -67,9 +64,11 @@ kauth(int argc, char **argv) overbose = verbose; verbose = 0; + save = set_command_prot(prot_private); ret = command("SITE KAUTH %s", name); if(ret != CONTINUE){ verbose = overbose; + set_command_prot(save); code = -1; return; } @@ -77,6 +76,7 @@ kauth(int argc, char **argv) p = strstr(reply_string, "T="); if(!p){ printf("Bad reply from server.\n"); + set_command_prot(save); code = -1; return; } @@ -84,6 +84,7 @@ kauth(int argc, char **argv) tmp = base64_decode(p, &tkt.dat); if(tmp < 0){ printf("Failed to decode base64 in reply.\n"); + set_command_prot(save); code = -1; return; } @@ -94,6 +95,7 @@ kauth(int argc, char **argv) if(!p){ printf("Bad reply from server.\n"); verbose = overbose; + set_command_prot(save); code = -1; return; } @@ -124,12 +126,14 @@ kauth(int argc, char **argv) memset(passwd, 0, sizeof(passwd)); if(base64_encode(tktcopy.dat, tktcopy.length, &p) < 0) { printf("Out of memory base64-encoding.\n"); + set_command_prot(save); code = -1; return; } memset (tktcopy.dat, 0, tktcopy.length); ret = command("SITE KAUTH %s %s", name, p); free(p); + set_command_prot(save); if(ret != COMPLETE){ code = -1; return; |