Bug 11830 - autopasswd from expect package doesn't work as expected
Summary: autopasswd from expect package doesn't work as expected
Alias: None
Product: Fedora
Classification: Fedora
Component: tcltk
Version: 1
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2000-06-01 20:08 UTC by bednar
Modified: 2007-11-30 22:10 UTC (History)
0 users

Clone Of:
Last Closed: 2004-06-21 12:41:16 UTC

Attachments (Terms of Use)

Description bednar 2000-06-01 20:08:00 UTC
The original /usr/bin/autopasswd, which should make it easy to change
passwords from scripts doesn't work as expected with passwd command, that
is supplied with redhat in package passwd. The fixed and working version
should look like this:

#!/usr/bin/expect -f
# wrapper to make passwd(1) be non-interactive
# username is passed as 1st arg, passwd as 2nd

set password [lindex $argv 1]
spawn passwd --stdin -f [lindex $argv 0]
expect "Changing password"
send "$password\r"
expect eof

Comment 1 Miloslav Trmac 2004-04-21 14:07:26 UTC
This is still an issue in expect-5.39.0-93.

Comment 2 Alan Cox 2004-06-21 12:41:16 UTC
Actually with pam even that won't work as the messages vary and
sometimes are not automatable (eg "insert smartcard now")

Removed autopasswd example.

Note You need to log in before you can comment on or make changes to this bug.