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

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-06-21 12:41:16 UTC
Type: ---
Embargoed:


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.