BuildSystem: detecting login failures ...

Lisandro Dalcin dalcinl at gmail.com
Tue Jul 28 13:09:42 CDT 2009


Satish, I had some discussion with Matt about how BuildSystem attempt
to detect login failures (BuildSystem/ at file script.py, in method
runShellCommand())... In my box, that code does not work as
expected... When I try to login via ssh (also if I try to run a
command using sudo), the "password:" banner is not written to stdout
or stderr, but the actual tty seems to be used... then the code in
runShellCommand() looking for "password:" is useless...

I've attached a script  stripping the uninsteresting part of
BuildSystem/script.py for you to test, that script basically do
runShellCommand() on what you pass in the command line, run for
example like this:

$ python runshcmd.py ls -al

Now try to use ssh to login, for example I'll show you what I do and get:

$ python runshcmd.py ssh fakeuser at localhost
Executing: ssh fakeuser at localhost
fakeuser at localhost's password:
fakeuser at localhost's password:
fakeuser at localhost's password:
out:
err:
ret: 65280

I have to hit Ctrl+D three times, but as you see the "... password:"
banner (and even the actual input stream taking my Ctrl+D hits) are
not the subprocess stdout|stderr (stdin), but the actuall parent's
tty... BTW, this is the behaviour I would expect for a program that
interactively ask for a password to users... In short, IMHO the
current code in BuildSystem seems to be useless in the general case
for detecting login failures...

Can any of you verify all this by using the attached script? Any idea
about how to improve/fix this?


-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
-------------- next part --------------
A non-text attachment was scrubbed...
Name: runshcmd.py
Type: application/octet-stream
Size: 1985 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20090728/d1ace30e/attachment.obj>


More information about the petsc-dev mailing list