Description of problem: The useradd program fails to add users into a chroot. Version-Release number of selected component (if applicable): 4.9 How reproducible: Always Steps to Reproduce: 1. useradd --prefix "$root" ... Actual results: It aborts with "free(): invalid pointer". Expected results: It should add the user. Additional info: It is fixed upstream, so it could be backported: https://github.com/shadow-maint/shadow/issues/394
Can you provide the exact reproduction steps? I've tried with the following ones and it works correctly: 1- mkdir -p $HOME/custom_root/etc/ && touch $HOME/custom_root/etc/passwd 2- sudo useradd -P $HOME/custom_root user4
It doesn't seem to reproduce with an empty root, but copying in a bunch of stuff from a real system causes it: [root@buildroot ~]# rm -fr /tmp/newroot && mkdir -p /tmp/newroot/etc && cp -at /tmp/newroot/etc /etc/{passwd,group,sub[ug]id,gshadow,shadow,login.defs,default} [root@buildroot ~]# useradd --prefix /tmp/newroot --groups=wheel --create-home --password= test free(): invalid pointer Aborted (core dumped) Apparently openSUSE hit this as well and backported the upstream commit: https://build.opensuse.org/package/view_file/openSUSE:Factory/shadow/shadow-fix-sigabrt.patch
Thanks for the steps! I'll include this in Fedora soon.
FEDORA-2021-7a723060da has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-7a723060da
FEDORA-2021-7a723060da has been pushed to the Fedora 35 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-7a723060da` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-7a723060da See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-2709419aea has been pushed to the Fedora 35 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-2709419aea` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-2709419aea See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-2709419aea has been pushed to the Fedora 35 stable repository. If problem still persists, please make note of it in this bug report.