Bug 1316168

Summary: "userdel -R" does not work
Product: [Fedora] Fedora Reporter: Miroslav Suchý <msuchy>
Component: shadow-utilsAssignee: Tomas Mraz <tmraz>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: cfergeau, pvrabec, tmraz
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: shadow-utils-4.6-4.fc28 shadow-utils-4.6-4.fc29 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-12-01 02:05:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Miroslav Suchý 2016-03-09 14:56:33 UTC
Description of problem:
"userdel --root" refuse to remove user in given chroot.

Version-Release number of selected component (if applicable):
shadow-utils-4.2.1-3.fc23.x86_64

How reproducible:
deterministic

Steps to Reproduce:
1. mock -r fedora-23-i386 --init
2. cat /var/lib/mock/fedora-23-i386/root/etc/passwd |grep mockbuild
mockbuild:x:0:482::/builddir:/bin/bash
3. LC_ALL=C sudo /usr/sbin/userdel --force -R /var/lib/mock/fedora-23-i386/root/ mockbuild
userdel: user 'mockbuild' does not exist


Actual results:
userdel: user 'mockbuild' does not exist

Expected results:
user mockbuild is removed

Comment 1 Miroslav Suchý 2016-03-09 15:05:19 UTC
Step 3 in reproducer is
LC_ALL=C sudo /usr/sbin/userdel --force -R /var/lib/mock/fedora-23-i386/root/ -r mockbuild
I forgot to copy here the -r option.

Comment 2 Tomas Mraz 2016-03-17 15:37:54 UTC
The problem is that userdel uses getpwnam() call in the chroot and that unfortunately fails because in the 32bit chroot there is no libnss_files.so to parse the /etc/passwd and shadow.

The --root feature is unfortunately only half-implemented and not really fully thought through and upstream development is very slow.

I would say even in 64bit chroot it is very undesirable to run any such libc calls and the parsing should be done only by shadow-utils.

Comment 3 Tomas Mraz 2016-03-17 15:39:52 UTC
Before the -R is used widely, the code would have to be reviewed and these getpw... calls workarounded.

Comment 4 Fedora End Of Life 2016-11-24 15:59:36 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Fedora End Of Life 2017-02-28 09:55:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 6 Fedora End Of Life 2018-05-03 08:43:11 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 7 Fedora End Of Life 2018-05-29 11:54:57 UTC
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26
is no longer maintained, which means that it will not receive any
further security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 8 Jan Kurik 2018-08-14 10:22:47 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 9 Fedora Update System 2018-11-08 15:52:39 UTC
shadow-utils-4.6-4.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-053fa23050

Comment 10 Fedora Update System 2018-11-08 15:53:00 UTC
shadow-utils-4.6-4.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-783dfc5196

Comment 11 Fedora Update System 2018-11-09 07:45:15 UTC
shadow-utils-4.6-4.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-053fa23050

Comment 12 Fedora Update System 2018-11-09 07:50:08 UTC
shadow-utils-4.6-4.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-783dfc5196

Comment 13 Fedora Update System 2018-12-01 02:05:10 UTC
shadow-utils-4.6-4.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2018-12-01 20:40:07 UTC
shadow-utils-4.6-4.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.