inetutils 1.5-4, ftp + inline password immediately quits
Robinson, Paul T (NonStop)
paul.t.robinson@hp.com
Fri Sep 12 23:32:00 GMT 2008
I have a pile of bash scripts with variations on this theme:
ftp -n ${HOST} <<FTP_EOF
user ${USER}
${PASSWORD}
cd ${MYDIR}
get ${MYFILE}
bye
FTP_EOF
With inetutils 1.5-4, the ftp client drops the connection to ${HOST}
right after it logs in (last thing it reads is the password).
Backing off to inetutils 1.3.2-40 lets the script succeed.
I didn't see anything in the mailing list archive that resembled
this problem.
I experimented with 1.5-4, and putting
user ${USER} ${PASSWORD}
on one line instead of separate lines also lets the script succeed.
So it doesn't seem like a network protocol problem. And used
interactively, prompting for the password works just fine. It's only
prompting for the password, plus accepting the password inline from
the bash script, that causes trouble.
In the announcement of 1.5-4, I looked through the change history
and noticed something about readline; maybe there's some interaction
between prompting, noecho, and the bash "here document" feature?
As a workaround I've backed off to the older version, but it would
be nice to stay up-to-date.
Here's what ftp -v -d reports for 1.5-4 with ${PASSWORD} on its own line:
$ cat ftptest.sh
ftp -v -d -n ${HOST} <<FTP_EOF
user ${USER}
${PASSWORD}
cd test
get testfile
bye
FTP_EOF
$ ftptest.sh
Connected to xxxxxxxx.
220 xxxxxxxx FTP SERVER T9552H02 (Version H02 TANDEM 16APR2008) ready.
---> SYST
215 Nonstop H-series Server : H06.15.
Remote system type is Nonstop.
user uuuuuuuu
---> USER uuuuuuuu
331 Password required for UUUUUUUU.
Password:
---> PASS XXXX
230 User UUUUUUUU logged in. GUARDIAN API enabled
---> QUIT
221 Goodbye.
So, it successfully logged in, but then immediately QUIT.
If I put ${PASSWORD} up on the 'user' command line, it continues
on to the 'cd' and 'get' with no problem.
Thanks,
--paulr
Cygwin Configuration Diagnostics
Current System Time: Fri Sep 12 14:31:14 2008
Windows XP Professional Ver 5.1 Build 2600 Service Pack 2
Running in Terminal Service session
Path: C:\cygwin\usr\local\bin
C:\cygwin\bin
C:\cygwin\bin
C:\cygwin\usr\X11R6\bin
c:\Perl\bin\
c:\mksnt\bin
c:\mksnt\bin\X11
c:\mksnt\mksnt
c:\WINDOWS\system32
c:\WINDOWS
c:\WINDOWS\System32\Wbem
c:\Program Files\ActivCard\ActivCard Gold\resources
c:\Program Files\Java\jre1.6.0_06\bin
c:\Rational\ClearCase\bin
c:\Rational\common
.
c:\DWF\bin
c:\YoDev\Path
Output from C:\cygwin\bin\id.exe (nontsec)
UID: 87996(ptr) GID: 10545(mkgroup-l-d)
0(root) 544(Administrators) 555(Remote Desktop Users)
545(Users) 10545(mkgroup-l-d)
Output from C:\cygwin\bin\id.exe (ntsec)
UID: 87996(ptr) GID: 10545(mkgroup-l-d)
0(root) 544(Administrators) 555(Remote Desktop Users)
545(Users) 10545(mkgroup-l-d)
SysDir: C:\WINDOWS\system32
WinDir: C:\WINDOWS
PWD = '/var/log'
HOME = '/cygdrive/c/Documents and Settings/PaulRobinson'
MAKE_MODE = 'unix'
MAN_TXT_INDEX = 'C:/mksnt/etc/tkutil.idx;C:/mksnt/etc/tkapi.idx;C:/mksnt/etc/tcltk.idx;C:/mksnt/etc/tkcurses.idx'
HOMEPATH = '\Documents and Settings\PaulRobinson'
MANPATH = '/usr/local/man:/usr/share/man:/usr/man:'
APPDATA = 'C:\Documents and Settings\PaulRobinson\Application Data'
HOSTNAME = 'PAULROBINSON-EV'
VS71COMNTOOLS = 'C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\'
ENVSDK_REGKEY = '7.0;7.1'
TERM = 'nutc'
PROCESSOR_IDENTIFIER = 'x86 Family 15 Model 1 Stepping 2, GenuineIntel'
MAN_CHM_INDEX = 'C:/mksnt/etc/chm/tkutil.idx;C:/mksnt/etc/chm/tkapi.idx;C:/mksnt/etc/chm/tcltk.idx;C:/mksnt/etc/chm/tkcurses.idx'
HPSIGNPROJ = 'PaulTRobinson'
WINDIR = 'C:\WINDOWS'
TMPDIR = '/cygdrive/c/DOCUME~1/PAULRO~1/LOCALS~1/Temp'
OLDPWD = '/var'
USERDOMAIN = 'AMERICAS'
OS = 'Windows_NT'
ALLUSERSPROFILE = 'C:\Documents and Settings\All Users'
MSVCVER = '6.00'
TEMP = '/cygdrive/c/DOCUME~1/PAULRO~1/LOCALS~1/Temp'
COMMONPROGRAMFILES = 'C:\Program Files\Common Files'
ROOTDIR = 'C:/mksnt'
TERMCAP = 'C:\mksnt\etc\termcap'
USERNAME = 'ptr'
PROCESSOR_LEVEL = '15'
MAN_HTM_PATHS = 'C:/mksnt/etc/htm/perl;C:/mksnt/etc/htm/perl/pod;C:/mksnt/etc/htm/perl/ext;C:/mksnt/etc/htm/perl/lib'
NUTCROOT = 'C:\mksnt'
FP_NO_HOST_CHECK = 'NO'
SYSTEMDRIVE = 'C:'
USERPROFILE = 'C:\Documents and Settings\PaulRobinson'
CLIENTNAME = 'Console'
AGENTMONSERVICE = '5402'
PS1 = '\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '
LOGONSERVER = '\\G6W0024'
HPSIGNDIR = 'C:\Program Files\Hewlett-Packard\HPCSS\HPCSS\HPSignClient1.1'
PROCESSOR_ARCHITECTURE = 'x86'
!C: = 'C:\cygwin\bin'
SHLVL = '1'
TERMINFO = 'C:\mksnt\usr\lib\terminfo'
PATHEXT = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.sh;.ksh;.csh;.sed;.awk;.pl'
HOMEDRIVE = 'C:'
PROMPT = '$P$G'
COMSPEC = 'C:\WINDOWS\system32\cmd.exe'
TMP = '/cygdrive/c/DOCUME~1/PAULRO~1/LOCALS~1/Temp'
SYSTEMROOT = 'C:\WINDOWS'
PRINTER = 'Microsoft Office Document Image Writer'
CVS_RSH = '/bin/ssh'
PROCESSOR_REVISION = '0102'
TDMROOTDIR = 'C:\DWF'
INFOPATH = '/usr/local/info:/usr/share/info:/usr/info:'
PROGRAMFILES = 'C:\Program Files'
DISPLAY = ':0.0'
NUMBER_OF_PROCESSORS = '1'
SESSIONNAME = 'RDP-Tcp#1'
TDMUSERFILE = 'c:\dwf\users\.netrc'
COMPUTERNAME = 'PAULROBINSON-EV'
SONICCENTRAL = 'C:\Program Files\Common Files\Sonic Shared\Sonic Central\'
_ = '/usr/bin/cygcheck'
HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
(default) = '/cygdrive'
cygdrive flags = 0x00000020
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
(default) = '/cygdrive'
cygdrive flags = 0x00000020
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/
(default) = 'C:\cygwin'
flags = 0x00000008
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin
(default) = 'C:\cygwin/bin'
flags = 0x00000008
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib
(default) = 'C:\cygwin/lib'
flags = 0x00000008
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options
a: fd N/A N/A
c: hd NTFS 19084Mb 96% CP CS UN PA FC PC COE
d: cd N/A N/A
i: net NTFS 522237Mb 100% CP CS UN PA FC N_Drive
j: net NTFS 104179Mb 44% CP CS UN PA FC E
k: net NTFS 104179Mb 44% CP CS UN PA FC E
m: net NTFS 104179Mb 44% CP CS UN PA FC E
v: net MVFS 1000Mb 50% CP CS CCase
. /cygdrive user textmode,cygdrive
C:\cygwin / system textmode
C:\cygwin/bin /usr/bin system textmode
C:\cygwin/lib /usr/lib system textmode
. /cygdrive system textmode,cygdrive
Found: C:\cygwin\bin\awk.exe
Found: c:\mksnt\mksnt\awk.exe
Warning: C:\cygwin\bin\awk.exe hides c:\mksnt\mksnt\awk.exe
Found: C:\cygwin\bin\bash.exe
Found: c:\mksnt\mksnt\bash.exe
Warning: C:\cygwin\bin\bash.exe hides c:\mksnt\mksnt\bash.exe
Found: C:\cygwin\bin\cat.exe
Found: c:\mksnt\mksnt\cat.exe
Warning: C:\cygwin\bin\cat.exe hides c:\mksnt\mksnt\cat.exe
Found: C:\cygwin\bin\cp.exe
Found: c:\mksnt\mksnt\cp.exe
Warning: C:\cygwin\bin\cp.exe hides c:\mksnt\mksnt\cp.exe
Found: c:\mksnt\bin\cpp.exe
Found: c:\mksnt\mksnt\crontab.exe
Found: C:\cygwin\bin\find.exe
Found: c:\mksnt\mksnt\find.exe
Warning: C:\cygwin\bin\find.exe hides c:\mksnt\mksnt\find.exe
Not Found: gcc
Not Found: gdb
Found: C:\cygwin\bin\grep.exe
Found: c:\mksnt\mksnt\grep.exe
Warning: C:\cygwin\bin\grep.exe hides c:\mksnt\mksnt\grep.exe
Found: C:\cygwin\bin\kill.exe
Found: c:\mksnt\mksnt\kill.exe
Warning: C:\cygwin\bin\kill.exe hides c:\mksnt\mksnt\kill.exe
Found: c:\mksnt\mksnt\ld.exe
Found: C:\cygwin\bin\ls.exe
Found: c:\mksnt\mksnt\ls.exe
Warning: C:\cygwin\bin\ls.exe hides c:\mksnt\mksnt\ls.exe
Found: C:\cygwin\bin\make.exe
Found: c:\mksnt\mksnt\make.exe
Warning: C:\cygwin\bin\make.exe hides c:\mksnt\mksnt\make.exe
Found: C:\cygwin\bin\mv.exe
Found: c:\mksnt\mksnt\mv.exe
Warning: C:\cygwin\bin\mv.exe hides c:\mksnt\mksnt\mv.exe
Found: c:\mksnt\mksnt\patch.exe
Found: c:\Perl\bin\perl.exe
Found: c:\mksnt\mksnt\perl.exe
Warning: c:\Perl\bin\perl.exe hides c:\mksnt\mksnt\perl.exe
Found: C:\cygwin\bin\rm.exe
Found: c:\mksnt\mksnt\rm.exe
Warning: C:\cygwin\bin\rm.exe hides c:\mksnt\mksnt\rm.exe
Found: C:\cygwin\bin\sed.exe
Found: c:\mksnt\mksnt\sed.exe
Warning: C:\cygwin\bin\sed.exe hides c:\mksnt\mksnt\sed.exe
Found: c:\mksnt\bin\ssh.exe
Found: C:\cygwin\bin\sh.exe
Found: c:\mksnt\mksnt\sh.exe
Warning: C:\cygwin\bin\sh.exe hides c:\mksnt\mksnt\sh.exe
Found: C:\cygwin\bin\tar.exe
Found: c:\mksnt\mksnt\tar.exe
Warning: C:\cygwin\bin\tar.exe hides c:\mksnt\mksnt\tar.exe
Found: C:\cygwin\bin\test.exe
Found: c:\mksnt\mksnt\test.exe
Warning: C:\cygwin\bin\test.exe hides c:\mksnt\mksnt\test.exe
Found: c:\mksnt\mksnt\vi.exe
Not Found: vim
61k 2008/04/01 C:\cygwin\bin\cygbz2-1.dll - os=4.0 img=1.0 sys=4.0
"cygbz2-1.dll" v0.0 ts=2008/3/31 20:37
7k 2003/10/19 C:\cygwin\bin\cygcrypt-0.dll - os=4.0 img=1.0 sys=4.0
"cygcrypt-0.dll" v0.0 ts=2003/10/19 0:57
40k 2006/11/15 C:\cygwin\bin\cygform-8.dll - os=4.0 img=1.0 sys=4.0
"cygform-8.dll" v0.0 ts=2006/11/14 23:06
25k 2008/01/04 C:\cygwin\bin\cyghistory6.dll - os=4.0 img=1.0 sys=4.0
"cyghistory6.dll" v0.0 ts=2008/1/3 19:31
271k 2007/08/24 C:\cygwin\bin\cygicons-0.dll - os=4.0 img=1.0 sys=4.0
"cygicons-0.dll" v0.0 ts=2007/8/24 0:24
976k 2006/10/22 C:\cygwin\bin\cygiconv-2.dll - os=4.0 img=1.0 sys=4.0
"cygiconv-2.dll" v0.0 ts=2006/10/22 16:44
37k 2003/08/10 C:\cygwin\bin\cygintl-2.dll - os=4.0 img=1.0 sys=4.0
"cygintl-2.dll" v0.0 ts=2003/8/10 14:50
31k 2005/11/20 C:\cygwin\bin\cygintl-3.dll - os=4.0 img=1.0 sys=4.0
"cygintl-3.dll" v0.0 ts=2005/11/19 18:04
31k 2006/10/23 C:\cygwin\bin\cygintl-8.dll - os=4.0 img=1.0 sys=4.0
"cygintl-8.dll" v0.0 ts=2006/10/22 17:12
21k 2006/11/15 C:\cygwin\bin\cygmenu-8.dll - os=4.0 img=1.0 sys=4.0
"cygmenu-8.dll" v0.0 ts=2006/11/14 23:05
67k 2006/11/15 C:\cygwin\bin\cygncurses++-8.dll - os=4.0 img=1.0 sys=4.0
"cygncurses++-8.dll" v0.0 ts=2006/11/14 23:13
237k 2006/11/15 C:\cygwin\bin\cygncurses-8.dll - os=4.0 img=1.0 sys=4.0
"cygncurses-8.dll" v0.0 ts=2006/11/14 23:02
12k 2006/11/15 C:\cygwin\bin\cygpanel-8.dll - os=4.0 img=1.0 sys=4.0
"cygpanel-8.dll" v0.0 ts=2006/11/14 23:04
151k 2008/07/08 C:\cygwin\bin\cygpcre-0.dll - os=4.0 img=1.0 sys=4.0
"cygpcre-0.dll" v0.0 ts=2008/7/8 12:30
303k 2008/07/08 C:\cygwin\bin\cygpcrecpp-0.dll - os=4.0 img=1.0 sys=4.0
"cygpcrecpp-0.dll" v0.0 ts=2008/7/8 12:30
7k 2008/07/08 C:\cygwin\bin\cygpcreposix-0.dll - os=4.0 img=1.0 sys=4.0
"cygpcreposix-0.dll" v0.0 ts=2008/7/8 12:30
22k 2002/06/09 C:\cygwin\bin\cygpopt-0.dll - os=4.0 img=1.0 sys=4.0
"cygpopt-0.dll" v0.0 ts=2002/6/8 22:45
155k 2008/01/04 C:\cygwin\bin\cygreadline6.dll - os=4.0 img=1.0 sys=4.0
"cygreadline6.dll" v0.0 ts=2008/1/3 19:31
1829k 2008/06/12 C:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
"cygwin1.dll" v0.0 ts=2008/6/12 10:35
Cygwin DLL version info:
DLL version: 1.5.25
DLL epoch: 19
DLL bad signal mask: 19005
DLL old termios: 5
DLL malloc env: 28
API major: 0
API minor: 156
Shared data: 4
DLL identifier: cygwin1
Mount registry: 2
Cygnus registry name: Cygnus Solutions
Cygwin registry name: Cygwin
Program options name: Program Options
Cygwin mount registry name: mounts v2
Cygdrive flags: cygdrive flags
Cygdrive prefix: cygdrive prefix
Cygdrive default prefix:
Build date: Thu Jun 12 19:34:46 CEST 2008
CVS tag: cr-0x5f1
Shared id: cygwin1S4
Potential app conflicts:
ZoneAlarm Personal Firewall
Detected: HKLM Registry Key.
Can't find the cygrunsrv utility, skipping services check.
Cygwin Package Information
Last downloaded files to: C:\Downloaded\Cygwin
Last downloaded files from: ftp://mirrors.kernel.org/sourceware/cygwin/
Package Version
_update-info-dir 00754-1
alternatives 1.3.30c-2
ash 20040127-4
base-files 3.7-1
base-passwd 2.2-1
bash 3.2.39-20
bison 2.3-1
bzip2 1.0.5-2
coreutils 6.10-1
crypt 1.1-1
csih 0.1.8-1
cygutils 1.3.2-1
cygwin 1.5.25-15
cygwin-doc 1.4-4
diffutils 2.8.7-1
editrights 1.01-2
expect 20030128-1
findutils 4.4.0-3
flex 2.5.35-1
flip 1.19-1
gawk 3.1.6-1
grep 2.5.1a-4
groff 1.19.2-2
gzip 1.3.12-2
inetutils 1.5-4
less 382-1
libbz2_1 1.0.5-2
libiconv2 1.11-1
libintl2 0.12.1-3
libintl3 0.14.5-1
libintl8 0.15-1
libncurses8 5.5-3
libpcre0 7.7-2
libpopt0 1.6.4-4
libreadline6 5.2.12-10
login 1.9-8
m4 1.4.10b-2
make 3.81-2
man 1.6e-1
rebase 2.4.4-1
run 1.1.10-1
sed 4.1.5-2
tar 1.20-1
tcltk 20080420-1
termcap 20050421-1
terminfo 5.5_20061104-1
texinfo 4.8a-1
tzcode 2008a-1
which 2.19-1
Use -h to see help about each section
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.ftp1.5-4.out
Type: application/octet-stream
Size: 12454 bytes
Desc: cygcheck.ftp1.5-4.out
URL: <http://cygwin.com/pipermail/cygwin/attachments/20080912/6d19367b/attachment.obj>
-------------- next part --------------
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list