Discussion:
[rancid] reason for autoenable?
Lee
2010-08-19 19:04:25 UTC
Permalink
... more newbie questions

If the userid automatically gets priv level 15 at login and you forget
to set the autoenable flag the clogin script times out waiting for the
">" prompt. Why was the autoenable flag added instead of changing the
expect script to look for # or >? It seems nicer not to require a
flag...

clogin line 743:
set ae [find autoenable $router]
if { "$ae" == "1" } {
set autoenable 1
set enable 0
set prompt "(#| \\(enable\\))"
} else {
set autoenable 0
set enable $avenable
# --old-- set prompt ">"
set prompt "(>|#| \\(enable\\))"
}

and
clogin -c "sh int status err-dis" switchName
now works if I use a regular userid or one that has enable privs at login time.

Thanks,
Lee
john heasley
2010-08-27 00:07:49 UTC
Permalink
Post by Lee
... more newbie questions
If the userid automatically gets priv level 15 at login and you forget
to set the autoenable flag the clogin script times out waiting for the
">" prompt. Why was the autoenable flag added instead of changing the
expect script to look for # or >? It seems nicer not to require a
flag...
i'll blame Hank again. autoenable just simplifies the code by moving the
burden.

I have a patch to remove it, but it still wants to enable. i'd like poeple
to test before its is committed. see attached.
Lee
2010-08-27 13:35:01 UTC
Permalink
Post by john heasley
Post by Lee
... more newbie questions
If the userid automatically gets priv level 15 at login and you forget
to set the autoenable flag the clogin script times out waiting for the
">" prompt. Why was the autoenable flag added instead of changing the
expect script to look for # or >? It seems nicer not to require a
flag...
i'll blame Hank again. autoenable just simplifies the code by moving the
burden.
I have a patch to remove it, but it still wants to enable. i'd like poeple
to test before its is committed. see attached.
I'll be glad to give it a try; I need to apply the patch to clogin.in
and then do a "make && make install" - correct?

I'm not going to be at work 'til Monday, so it'll be a few days

Thanks,
Lee
john heasley
2010-08-27 14:55:38 UTC
Permalink
Post by Lee
Post by john heasley
Post by Lee
... more newbie questions
If the userid automatically gets priv level 15 at login and you forget
to set the autoenable flag the clogin script times out waiting for the
">" prompt. Why was the autoenable flag added instead of changing the
expect script to look for # or >? It seems nicer not to require a
flag...
i'll blame Hank again. autoenable just simplifies the code by moving the
burden.
I have a patch to remove it, but it still wants to enable. i'd like poeple
to test before its is committed. see attached.
I'll be glad to give it a try; I need to apply the patch to clogin.in
and then do a "make && make install" - correct?
either clogin or clogin.in; the patch affects nothing that is replaced by
the autoconf process.
Lee
2010-08-31 13:49:01 UTC
Permalink
Post by john heasley
Post by Lee
Post by john heasley
Post by Lee
... more newbie questions
If the userid automatically gets priv level 15 at login and you forget
to set the autoenable flag the clogin script times out waiting for the
">" prompt. Why was the autoenable flag added instead of changing the
expect script to look for # or >? It seems nicer not to require a
flag...
i'll blame Hank again. autoenable just simplifies the code by moving the
burden.
I have a patch to remove it, but it still wants to enable. i'd like poeple
to test before its is committed. see attached.
I'll be glad to give it a try; I need to apply the patch to clogin.in
and then do a "make && make install" - correct?
either clogin or clogin.in; the patch affects nothing that is replaced by
the autoconf process.
Works for me :)

I patched clogin & had no problems with a
clogin -c "sh int status err" $DEV
on various IOS switches at work. We don't have any CatOS switches, so
I couldn't test that.

Thanks,
Lee

Hank Kilmer
2010-08-27 15:34:33 UTC
Permalink
Post by john heasley
Post by Lee
... more newbie questions
If the userid automatically gets priv level 15 at login and you forget
to set the autoenable flag the clogin script times out waiting for the
">" prompt. Why was the autoenable flag added instead of changing the
expect script to look for # or >? It seems nicer not to require a
flag...
i'll blame Hank again. autoenable just simplifies the code by moving the
burden.
I must admit, that one is my fault. It is a product of having working
code long ago, changing some of our routers to autoenable for some
account and realizing I needed to update rancid to match. It was how my
brain works...I like to explicitly tell programs what I want and expect.
The more thinking they do for me, the more mistakes can get hidden.
This one, however, is a bit overkill in hindsight.
Post by john heasley
I have a patch to remove it, but it still wants to enable. i'd like poeple
to test before its is committed. see attached.
Let's get this tested!
-Hank
Loading...