From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "T. Horsnell \(tsh\)" Newsgroups: gmane.os.tru64.managers Subject: ftp-client w/o controlling tty Date: Mon, 17 Jan 2005 16:50:31 +0000 (GMT) Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1105980698 21800 80.91.229.6 (17 Jan 2005 16:51:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 17 Jan 2005 16:51:38 +0000 (UTC) Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Mon Jan 17 17:51:10 2005 Return-path: Original-Received: from sws1.ornl.gov ([160.91.1.101]) by deer.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 1Cqa5s-0006dU-00 for ; Mon, 17 Jan 2005 17:51:09 +0100 Original-Received: (qmail 14908 invoked by uid 5); 17 Jan 2005 16:50:56 -0000 Original-Sender: tru64-unix-managers-owner@ornl.gov Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 14893 invoked by uid 49501); 17 Jan 2005 16:50:56 -0000 Original-Received: from tsh@mrc-lmb.cam.ac.uk by sws1 by uid 49491 with qmail-scanner-1.21 (clamdscan: 0.70-rc. iscan: v3.1/v5.600-1011/847/50540. spamassassin: 2.63. Clear:RC:0(160.91.4.119):SA:0(-2.6/5.0):. Processed in 0.71428 secs); 17 Jan 2005 16:50:56 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (160.91.4.119) by 0 with SMTP; 17 Jan 2005 16:50:55 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.2-X27 #30899) with ESMTP id <0IAH00F9404T0G@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Mon, 17 Jan 2005 11:50:54 -0500 (EST) Original-Received: from VIRUSCAN-DAEMON.emroute1.cind.ornl.gov by emroute1.cind.ornl.gov (PMDF V6.2-X27 #30899) id <0IAH0040204DJM@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Mon, 17 Jan 2005 11:50:43 -0500 (EST) Original-Received: from ppsw-3.csi.cam.ac.uk (ppsw-3.csi.cam.ac.uk [131.111.8.133]) by emroute1.cind.ornl.gov (PMDF V6.2-X27 #30899) with ESMTP id <0IAH0043804CDI@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Mon, 17 Jan 2005 11:50:37 -0500 (EST) Original-Received: from server1.mrc-lmb.cam.ac.uk ([131.111.85.23]:40826) by ppsw-3.csi.cam.ac.uk (ppsw.cam.ac.uk [131.111.8.133]:25) with esmtp id 1Cqa5J-0001Fl-BH (Exim 4.44) for tru64-unix-managers@ornl.gov (return-path ); Mon, 17 Jan 2005 16:50:33 +0000 Original-Received: from alf1.lmb.internal ([10.1.0.1]) by server1.mrc-lmb.cam.ac.uk with esmtp (Exim 4.10) id 1Cqa5I-0005bW-00 for tru64-unix-managers@ornl.gov; Mon, 17 Jan 2005 16:50:32 +0000 Original-Received: from tsh by alf1.lmb.internal with local (Exim 4.32) id 1Cqa5I-001Ikn-BM for tru64-unix-managers@ornl.gov; Mon, 17 Jan 2005 16:50:32 +0000 Original-To: Managers X-Mailer: ELM [version 2.4ME+ PL66 (25)] X-Envelope-From: X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ X-Cam-AntiVirus: No virus found X-Cam-SpamDetails: Not scanned Xref: main.gmane.org gmane.os.tru64.managers:7941 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:7941 Thanks to Lucio Chiappetti and Rob Leadbeater, I'm in business. Lucio pointed out that with the -n switch, I could do #ftp -n somehost < ftpcommandfile and thus not need the .netrc. This works from my httpd->cgi script. Rob Leadbeater also suggested the Perl Net::FTP, which I'll try later. This may be a neater solution that my bunch of perl system calls. Cheers, Terry. >Hi all, >I'm trying to make an ftp transfer from with a cgi script, and >want the ftp client to use my .netrc file. The cgi script is >run by an http daemon owned by me. > >If I run the test command: > >#perl -e 'system "ftp desthost"' > >everything works as expected, and the userid, passwd and ftp commands are >taken from .netrc. However when the command runs from within the cgi >script (under the control of the http daemon and hence no controlling tty), >the ftp command appears to try to run an interactive session, rather than >using the .netrc file, and of course fails. > >Any ideas how I can force it to use .netrc? Or alternative means of doing >the ftp? I've tried building the wu-ftp client but it moans about a lack >of termcap.h :( Has anyone built alternative ftp clients on Tru64?