Don't allow a file name as the "log" argument to FTP-CONNECT---the

library never bothered closing the port anyway.
This commit is contained in:
sperber 2003-01-16 13:55:13 +00:00
parent 6af4ba85de
commit b81da26fdc
1 changed files with 2 additions and 12 deletions

View File

@ -72,18 +72,8 @@
;; beware, the log file contains password information! ;; beware, the log file contains password information!
(define (ftp-connect host login password passive? . args) (define (ftp-connect host login password passive? . args)
(let-optionals* args ((logfile #f)) (let-optionals* args ((log #f))
(let* ((log (cond (let* ((hst-info (host-info host))
((output-port? logfile)
logfile)
((string? logfile)
(open-output-file logfile
(if (file-exists? logfile)
(bitwise-ior open/write open/append)
(bitwise-ior open/write open/create))
#o600))
(else #f)))
(hst-info (host-info host))
(hostname (host-info:name hst-info)) (hostname (host-info:name hst-info))
(srvc-info (service-info "ftp" "tcp")) (srvc-info (service-info "ftp" "tcp"))
(sock (socket-connect protocol-family/internet (sock (socket-connect protocol-family/internet