chpasswd mishandles --root option

Bug #1822501 reported by Colin Hogben
6
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)

Balint Reczey (rbalint)
Changed in shadow (Ubuntu):
importance: Undecided → Low
Revision history for this message
Colin Hogben (ubuntu-colinhogben) wrote :

I decided to "scratch my own itch" and submitted a PR upstream.

https://github.com/shadow-maint/shadow/issues/219

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.