two patches for efs-1.12

jeff (jsparkes@bnr.ca)
Fri, 30 Sep 1994 14:50:00 -0400


I did a bad jobs of checking the source into RCS, so I'm sending a
patch for two different things.

First is a change to add the original password as a default when
retrying a failed login.  I often get this from sites like
ftp.cdrom.com that reject logins when the load is high.  The code in
efs to detect the situation only seems to look at lines prefixed with
"530 ", not "530-", which is where is ftp.cdrom.com warns.

With this patch, I just have to hit return and don't mess up my cached
password entry.

The second part is related.  We have a new proxy ftp server that seems
to be different from what efs expects.  It uses a userid and account
password on the gateway machine to authenticate me. Here's a typical session:
ftp> open ottgate
...
ftp> quote user ftp@ftp.cdrom.com jsparkes
331 password ...
I send "jsparkes@bnr.ca"
332 account password
I send my YP password here..

I don't know how the proxy ftp works (is that RFC-959?), but i had to
make changes the append my userid to the hostname in
efs-login-send-user.

I also modified efs-login-send-acct to prompt for
gateway-user@gateway, so that I don't have to enter the same account
password for each machine I log into.

Both of these proxy changes are controlled by a new variable:
efs-gateway-user, and are off by default.

The gateway product is called Raptor, from a company called Eagle.

BTW, if they have not followed the spec for proxy ftp (and it allows
for a userid/password pair authentication on the gateway) please let
me know so I can complain to the vendor.  It's still early enough to
get them to fix it.

*** 1.1	1994/09/21 14:25:39
--- efs.el	1994/09/30 18:36:36
***************
*** 1,3 ****
--- 1,4 ----
+ ;;;* Last edited: Sep 21 13:54 1994 (jsparkes)
  ;; -*-Emacs-Lisp-*-
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;
***************
*** 1036,1041 ****
--- 1037,1045 ----
  (defvar efs-gateway-ftp-prompt-regexp "^\\(ftp\\|Ftp\\|FTP\\)> *"
    "*Regular expression to match the prompt of the gateway FTP client.")
  
+ (defvar efs-gateway-user nil
+   "*Username used for authentication for some varieties of proxy gateways.
+ This username is append to the hostname in the proxy ftp user prompt.")
  ;;; End of gateway config variables.
  
  (defvar efs-tmp-name-template "/tmp/efs"
***************
*** 2578,2583 ****
--- 2582,2592 ----
  If the optional REALLY argument is given, prompts the user if it can't find
  one."
    (efs-parse-netrc)
+   ;; We need to authorize for the gateway host with account info. Otherwise,
+   ;; we get prompted for the same password for each different host.
+   (if efs-gateway-user
+       (setq host efs-gateway-host
+ 	    user efs-gateway-user))
    (let ((account (if minidisk
  		     (efs-get-hash-entry
  		      (concat (downcase host) "/" user "/" minidisk)
***************
*** 3303,3309 ****
  If HOST is only ftp-able through a gateway machine then spawn a shell
  on the gateway machine to do the ftp instead. NAME is the name of the
  process."
!   (let* ((use-gateway (efs-use-gateway-p host))
  	 (buffer (get-buffer-create (efs-ftp-process-buffer host user)))
  	 (process-connection-type t)
  	 (opaque-p (memq use-gateway efs-opaque-gateways))
--- 3312,3318 ----
  If HOST is only ftp-able through a gateway machine then spawn a shell
  on the gateway machine to do the ftp instead. NAME is the name of the
  process."
!   (let* ((use-gateway (efs-use-gateway-p host t))
  	 (buffer (get-buffer-create (efs-ftp-process-buffer host user)))
  	 (process-connection-type t)
  	 (opaque-p (memq use-gateway efs-opaque-gateways))
***************
*** 3981,3992 ****
  		 ;; Seems that some lame gateways require the user command
  		 ;; in upper case. RFC959 specifies that this must be case
  		 ;; insensitive. sigh...
! 		 (format "quote USER \"%s\"@%s"
  			 user
  			 (if (and efs-nslookup-on-connect
  				  (string-match "[^0-9.]" host))
  			     (efs-nslookup-host host)
! 			   host))
  	       (format "quote user \"%s\"" user)))
  	(msg (format "Logging in as user %s%s..." user
  		     (if use-gateway (concat "@" host) "")))
--- 3990,4001 ----
  		 ;; Seems that some lame gateways require the user command
  		 ;; in upper case. RFC959 specifies that this must be case
  		 ;; insensitive. sigh...
! 		 (format "quote USER \"%s\"@%s %s"
  			 user
  			 (if (and efs-nslookup-on-connect
  				  (string-match "[^0-9.]" host))
  			     (efs-nslookup-host host)
! 			   host) efs-gateway-user)
  	       (format "quote user \"%s\"" user)))
  	(msg (format "Logging in as user %s%s..." user
  		     (if use-gateway (concat "@" host) "")))
***************
*** 4100,4106 ****
  			     (read-passwd
  			      (format
  			       "Password for %s@%s failed. Try again: "
! 			       user host)))))
  		  (fillarray pass 0))
  		(setq result nil)
  		(efs-login-send-user host user proc
--- 4109,4115 ----
  			     (read-passwd
  			      (format
  			       "Password for %s@%s failed. Try again: "
! 			       user host) nil pass))))
  		  (fillarray pass 0))
  		(setq result nil)
  		(efs-login-send-user host user proc
***************
*** 4143,4149 ****
  			     qacct (efs-quote-string nil acct t)
  			     cmd (concat "quote acct " qacct))
  		       (efs-raw-send-cmd proc cmd))
! 		   (fillarray acct 0)
  		   (fillarray qacct 0)
  		   (fillarray cmd 0))))
      ;; Analyze the result
--- 4152,4158 ----
  			     qacct (efs-quote-string nil acct t)
  			     cmd (concat "quote acct " qacct))
  		       (efs-raw-send-cmd proc cmd))
! 		   ;;(fillarray acct 0)
  		   (fillarray qacct 0)
  		   (fillarray cmd 0))))
      ;; Analyze the result
***************
*** 4160,4166 ****
  		  (setq acct (read-passwd
  			      (format
  			       "Account password for %s@%s failed. Try again: "
! 			       user host)))
  		  (or (and efs-high-security-hosts
  			   (string-match efs-high-security-hosts
  					 (format "%s@%s" user host)))
--- 4169,4175 ----
  		  (setq acct (read-passwd
  			      (format
  			       "Account password for %s@%s failed. Try again: "
! 			       user host) nil acct))
  		  (or (and efs-high-security-hosts
  			   (string-match efs-high-security-hosts
  					 (format "%s@%s" user host)))
--
Jeff Sparkes
jsparkes@bnr.ca    Bell-Northern Research, Ottawa, Ontario, Canada