Bug 79846 - mkpasswd hangs often
mkpasswd hangs often
Product: Fedora
Classification: Fedora
Component: expect (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jens Petersen
Bill Huang
Depends On:
  Show dependency treegraph
Reported: 2002-12-17 09:53 EST by Peter Surda
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-08-05 00:17:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Strace of passwd being run from mkpasswd (18.72 KB, text/plain)
2002-12-20 01:04 EST, Peter Surda
no flags Details

  None (edit)
Description Peter Surda 2002-12-17 09:53:55 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021203

Description of problem:
It might seem odd that I report this as a glibc problem, but I can reproduce it
on 5 completely unrelated systems and the only thing in common upgraded lately
is glibc.

Basically, mkpasswd stopped working about a month ago. When I run it with -v, it
shows that passwd ignores the input, mkpasswd kills it after a couple of seconds
and claims that password has changed, but it hasn't. Also, /etc/.pwd.lock
appears and isn't deleted.

I have been using mkpasswd the same way for almost 3 years.

Actually, I noticed that since glibc upgrade if you run mkpasswd first time ever
on the system, it seems to work. After that, it NEVER works, even if you delete
/etc/.pwd.lock. It looks like something is locked somewhere hidden :-)

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. mkpasswd some_user_login
2. wait
3. mkpasswd reports success but nothing happened. Sometimes, it just hangs instead.

Actual Results:  mkpasswd either hangs or reports success (but doesn't change
password). First time ever on a system it seems to work correctly, but after
that it's broken.

Expected Results:  The password should have been changed.

Additional info:

I can reproduce this on three 7.2 systems, one 7.3 and one 8.0.
Comment 1 Peter Surda 2002-12-20 01:03:13 EST
New tests show that if you leave machine running without running mkpasswd for a
couple of days, it magically fixes itself. I double checked none of
passwd/mkpasswd/expect are running in the background while this happens (that
could have caused the files to be locked).

A typical session looks like this:
[root@noir tmp]# rm -f /etc/.pwd.lock;grep tester /etc/shadow;mkpasswd -v
tester;grep tester /etc/shadow
spawn passwd tester
Changing password for user tester
New password: J63nap}Cd

Retype new password: J63nap}Cd
password for tester is J63nap}Cd

As you see, the password wasn't changed.

I was able to reproduce it on 2 other machines now AND I could also check it
possibly isn't glibc related, because it also happens on glibc-2.2.4-29.

I am attaching a strace of the passwd being run from mkpasswd, perhaps then
someone can find the cause and fix it.

MfG shurdeek
Comment 2 Peter Surda 2002-12-20 01:04:21 EST
Created attachment 88827 [details]
Strace of passwd being run from mkpasswd
Comment 3 Ulrich Drepper 2003-04-22 03:46:26 EDT
I doubt that this problem has anything to do with glibc.

First, can you try this with RHL9?

Second, I've assigned the problem to tcltk.  expect is listed as the package
which contains this problem.
Comment 4 Jens Petersen 2003-04-22 07:50:44 EDT
Are you still seeing this with recent releases of Red Hat Linux?
Comment 5 Peter Surda 2003-04-22 17:54:46 EDT
I currently don't have a RH9 machine. It's still broken with latest rh8 updates
though. Anyway, it isn't important to me anymore, there is a simple workaround,
instead of "mkpasswd user" use "mkpasswd|passwd --stdin user".
Comment 6 Matteo Corti 2003-06-16 04:10:56 EDT
I confirm a similar behaviour on RH 9. mkpasswd sometimes (quite often) simply
hangs. I was not able to reproduce the problem with strace (in this case the
mkpasswd terminates correctly.

^C does not work and to kill the process you need to send a KILL signal.
Comment 7 Jens Petersen 2004-02-26 02:45:59 EST
mkpasswd still hangs for me reproducibly with expect-5.39.0.
Comment 8 Jens Petersen 2004-08-05 00:17:39 EDT
mkpasswd has been removed in expect-5.39.0-98:

* Mon Jun 21 2004 Alan Cox <alan@redhat.com>
- Autopasswd doesnt work and isnt ever going to work with pam around
  since password setting depends on the modules in use (think
  "fingerprint" or "smartcard"..). Remove it.

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