[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ftp -n requires password



Peter Ehlin <pelin@voxi.se> writes:
> Hi

Hello

> I'm trying to write a simple script that does ftp from a host
> to another.
> 
> cat <<EOF | ftp host
> 
> bin
> get fil.tar.gz
> EOF
> 
> But that didn't work.

Strange, that works for me.  But I'm afraid it might depend on your
combination of OS/readline/editline/libedit.  What's your particular
coordinates?  You can also try adding `-g' (which should disable the
second variable from the equation).

> But it seems like -n requires a password even though I have a valid ticket.
> Is that a bug in ftp? Or is it for compatibility reasons?

Hm, I'm not sure how it is supposed to work.  But I think I have to
agree with you, changing it as below also makes ange-ftp somewhat
happier.

/assar

Index: cmds.c
===================================================================
RCS file: /afs/pdc.kth.se/src/packages/kth-krb/SourceRepository/appl/ftp/ftp/cmds.c,v
retrieving revision 1.44
diff -u -w -r1.44 cmds.c
--- cmds.c	2001/08/05 06:39:14	1.44
+++ cmds.c	2001/10/05 06:26:33
@@ -139,6 +139,12 @@
 		stru = STRU_F;
 		strlcpy(bytename, "8", sizeof(bytename));
 		bytesize = 8;
+
+		if(sec_login(host))
+		    printf("\n*** Using plaintext user and password ***\n\n");
+		else{
+		    printf("Authentication successful.\n\n");
+		}
 		if (autologin)
 			login(argv[1]);
 
Index: ftp.c
===================================================================
RCS file: /afs/pdc.kth.se/src/packages/kth-krb/SourceRepository/appl/ftp/ftp/ftp.c,v
retrieving revision 1.70
diff -u -w -r1.70 ftp.c
--- ftp.c	2001/09/07 20:28:10	1.70
+++ ftp.c	2001/10/05 06:26:33
@@ -175,12 +175,6 @@
 
     user = pass = acct = 0;
 
-    if(sec_login(host))
-	printf("\n*** Using plaintext user and password ***\n\n");
-    else{
-	printf("Authentication successful.\n\n");
-    }
-
     if (ruserpass (host, &user, &pass, &acct) < 0) {
 	code = -1;
 	return (0);