chpasswd mishandles --root option
Bug #1822501 reported by
Colin Hogben
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
shadow (Ubuntu) |
New
|
Low
|
Unassigned |
Bug Description
I did
echo root:secret | chpasswd --root=/mnt/img
I expected the password to be changed on the mounted filesystem at /mnt/img
Instead, it changed the password on the host filesystem.
Although the chpasswd(1) manual page does not list --root=CHROOT_DIR as valid syntax, it is common for programs to accept both --arg param and --arg=param as valid syntax (as per gnu getopt_long). At the very least, chpasswd should fail with an error report if unacceptable option syntax is used, rather than ignoring it.
passwd 1:4.5-1ubuntu1 on Ubuntu 18.04.2 LTS
(though bug tracker seems to think this does not exist in Ubuntu)
Changed in shadow (Ubuntu): | |
importance: | Undecided → Low |
To post a comment you must log in.
I decided to "scratch my own itch" and submitted a PR upstream.
https:/ /github. com/shadow- maint/shadow/ issues/ 219