Discussion:
[rancid] jlogin timeout
Jean BENOIT
2008-01-14 18:09:56 UTC
Permalink
Hello,

jlogin stopped working after I upgraded expect.
I am using expect-devel from the FreeBSD ports,
which is based on expect 5.44.1
(reasons for upgrading expect :
http://www.shrubbery.net/pipermail/rancid-discuss/2008-January/002672.html
)

While doing a ssh password authentication on a
Juniper router, expect finds no matching expression.
Previous version of expect was tolerant with this line :

"\[Pp]assword:" {
sleep 1; send "$passwd\r"
exp_continue
}

The "-re" flag should be provided for this line to work.

--
Jean
john heasley
2008-01-15 21:44:20 UTC
Permalink
Post by Jean BENOIT
Hello,
jlogin stopped working after I upgraded expect.
I am using expect-devel from the FreeBSD ports,
which is based on expect 5.44.1
http://www.shrubbery.net/pipermail/rancid-discuss/2008-January/002672.html
)
While doing a ssh password authentication on a
Juniper router, expect finds no matching expression.
"\[Pp]assword:" {
sleep 1; send "$passwd\r"
exp_continue
}
The "-re" flag should be provided for this line to work.
I don't think that should be necessary, since [] are valid in globs, which
is the default pattern matching and is cheaper than regex. I've tested it
with tcl 8.4.14 and expect 8.4.7 and it works as expected and has worked
with 8.3 in the past.

So, there is another tcl regression. You should open a freebsd ports
ticket; I suspect this is a general problem with their build of the tcl83
port.
Jean BENOIT
2008-01-17 03:24:23 UTC
Permalink
Post by john heasley
Post by Jean BENOIT
I am using expect-devel from the FreeBSD ports,
http://www.shrubbery.net/pipermail/rancid-discuss/2008-January/002672.html
[...]
Post by john heasley
Post by Jean BENOIT
"\[Pp]assword:" {
The "-re" flag should be provided for this line to work.
I don't think that should be necessary, since [] are valid in globs, which
is the default pattern matching and is cheaper than regex. I've tested it
You are right.

The expect-devel ports uses the latest version of exp_glob.c from
the expect cvs (rev. 5.34, dated 2007/07/17) which definitely has
an issue. This simple example :

exp_internal 1 ; spawn sh -c "echo a && cat" ; expect {[a]} {puts ok}

times out with :

expect: does "a\r\n" (spawn_id exp6) match glob pattern "[a]"? no
expect: timed out

There is even debug code in exp_glob.c.
I am not sure this code has been really tested and is
supposed to work ...
I didn't have time to locate the bug precisely.
I submitted a bug in the Sourceforge Expect bug tracker.
Post by john heasley
with tcl 8.4.14 and expect 8.4.7 and it works as expected and has worked
with 8.3 in the past.
So, there is another tcl regression. You should open a freebsd ports
ticket; I suspect this is a general problem with their build of the tcl83
port.
It has nothing to do with a tcl regression. The problem is in expect.
Suggesting expect-devel as a solution to the pty problem was probably
not a wise move.

--
Jean Benoit
Centre Réseau Communication
Université Louis Pasteur, Strasbourg, France

Loading...