adduser mangles /etc/passwd entry if shell argument not given
Found in alpine 3.3.1 (gliderlabs/alpine for Docker) with confirmed reproduction on hardware (VM).
https://github.com/gliderlabs/docker-alpine/issues/141
There is an upstream bug in BusyBox 8586 but it is indicated this should
already have been fixed in 1.24.1.
https://bugs.busybox.net/show\_bug.cgi?id=8586
# adduser -h /home/lxcmedia -g "lxc-media user" -u 1024 -G 100 -D lxcmedia
# grep lxc-media /etc/passwd
lxcmedia:x:1024:100:lxc-media user:/home/lxcmedia:obody
# adduser -h /home/bugtest -g "bugtest user" -u 2048 -G 100 -D -s /bin/sh bugtest
# grep bugtest /etc/passwd
bugtest:x:2048:100:bugtest user:/home/bugtest:/bin/sh
(from redmine: issue id 5083, created on 2016-02-07, closed on 2019-03-05)
- Relations:
- duplicates #6742 (closed)
- Changesets:
- Revision 4a3258e6 on 2019-01-12T11:44:45Z:
main/busybox: fix creation of invalid shell entry by adduser
Fixes #5083
Fixes #6742