Bug 9917 - autopasswd doesn't work at all
autopasswd doesn't work at all
Product: Red Hat Linux
Classification: Retired
Component: tcltk (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jens Petersen
Depends On:
  Show dependency treegraph
Reported: 2000-03-02 06:06 EST by Geoffrey D. Bennett
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-01-16 02:48:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Geoffrey D. Bennett 2000-03-02 06:06:17 EST
The autopasswd script included with tcl/tk doesn't work at all because it
sends the password before passwd starts listening for a password.  This
results in the script just hanging.

Even if it did work, certain passwords (eg. those beginning with a hyphen)
cannot be set because the password is interpreted as an option to "send".

The replacement script below fixes both of the above problems.  I don't
know if the 0.1s sleep is sufficient in all cases, but I've not had it fail
for me yet.

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

set password [lindex $argv 1]
spawn passwd [lindex $argv 0]
expect "password:"
sleep 0.1
send -- "$password\r"
expect "password:"
sleep 0.1
send -- "$password\r"
expect eof
Comment 1 Jeff Johnson 2000-03-18 15:58:59 EST
*** This bug has been marked as a duplicate of 4768 ***
Comment 2 Geoffrey D. Bennett 2002-10-16 08:38:10 EDT
I don't think this bug is resolved.  Bug 4768 has nothing to do with autopasswd.
 Although the timing issue seems to have gone away in later releases of RHL, the
problem with not being able to put in passwords beginning with hyphens is still
Comment 3 Jens Petersen 2002-12-10 01:24:11 EST
Should be fixed in expect-5.38.0-76.
Comment 4 Jens Petersen 2003-01-16 02:48:34 EST
Closing for now.  Please re-open if there are still problems.

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