Bugzilla – Bug 131499
passwd command can't be cancelled
Last modified: 2005-10-30 20:44:44 UTC
Once the passwd command is running, there's no way to cancel it. This is majorly annoying, and when running as root, actively dangerous - hitting the return key a few times (since this is the only thing which gets any response at all) leaves root with no password being set or asked for at the next login. Because there isn't a "security" tag to tick I'm setting severity one level up from normal.
I assume you try Ctrl-C. Blocking Ctrl-C is the only way to make sure that the passwd database is always consistent and will not be corrupted. With Ctrl-D you can stop changing the password.
Yes, ^C doesn't work. ^Z doesn't work either, so one would need another shell and a hunt for the pid to kill it. Any chance of adding a brief note like "(press ctrl-D to quit)" to the initial terminal output of passwd? There should also be an explicit note upon termination of passwd when an empty password was installed, i.e. is now unset.