Bug 1986111 - groupdel gives segmentation fault when using '-P'
Summary: groupdel gives segmentation fault when using '-P'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: shadow-utils
Version: 34
Hardware: x86_64
OS: Linux
high
urgent
Target Milestone: ---
Assignee: Iker Pedrosa
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-26 17:18 UTC by Roy Lenferink
Modified: 2022-01-04 09:18 UTC (History)
6 users (show)

Fixed In Version: shadow-utils-4.9-8.fc35 shadow-utils-4.8.1-10.fc34
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-26 01:22:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Roy Lenferink 2021-07-26 17:18:07 UTC
Description of problem:
When using groupdel with a prefix path, it segfaults on Fedora 34.
groupadd and groupmod both are working fine.

Version-Release number of selected component (if applicable):
shadow-utils-4.8.1-8.fc34.x86_64

How reproducible:
Every time groupdel is executed (as root)

Steps to Reproduce:
1. Create a custom /etc/group file, e.g. using
[root@fedora ~]# mkdir -p $HOME/custom_root/etc/ && touch $HOME/custom_root/etc/group
2. Create a group (succeeds)
[root@fedora ~]# groupadd -P $HOME/custom_root test_group
3. Delete the group (fails)
[root@fedora ~]# groupdel -P $HOME/custom_root test_group

Actual results:
[root@fedora ~]# groupdel -P $HOME/custom_root test_group
Segmentation fault (core dumped)

Expected results:
Return code 0 with the group deleted from $HOME/custom_root/etc/group

Additional info:
[root@fedora ~]# gdb --args groupdel -P $HOME/custom_root test_group
(gdb) run
Starting program: /usr/sbin/groupdel -P /root/custom_root test_group

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7df795b in fgetpos@@GLIBC_2.2.5 () from /lib64/libc.so.6
(gdb) bt
#0  0x00007ffff7df795b in fgetpos@@GLIBC_2.2.5 () from /lib64/libc.so.6
#1  0x00007ffff7e4d442 in fgetpwent () from /lib64/libc.so.6
#2  0x000055555555882c in main ()
(gdb) 

[root@fedora ~]# rpm -qa | grep glibc
glibc-all-langpacks-2.33-20.fc34.x86_64
glibc-common-2.33-20.fc34.x86_64
glibc-langpack-en-2.33-20.fc34.x86_64
glibc-2.33-20.fc34.x86_64
glibc-doc-2.33-20.fc34.noarch
glibc-headers-x86-2.33-20.fc34.noarch
glibc-devel-2.33-20.fc34.x86_64

Comment 1 Iker Pedrosa 2021-11-19 08:28:30 UTC
master
    groupdel: fix SIGSEGV when passwd does not exist - a757b458ffb4fb9a40bcbb4f7869449431c67f83

Comment 2 Fedora Update System 2021-11-23 08:48:14 UTC
FEDORA-2021-380251ce99 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-380251ce99

Comment 3 Fedora Update System 2021-11-24 01:57:06 UTC
FEDORA-2021-380251ce99 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-380251ce99`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-380251ce99

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2021-11-26 01:22:22 UTC
FEDORA-2021-380251ce99 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 5 Fedora Update System 2021-11-30 14:44:52 UTC
FEDORA-2021-6ac83612a5 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-6ac83612a5

Comment 6 Fedora Update System 2021-12-01 01:56:29 UTC
FEDORA-2021-6ac83612a5 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-6ac83612a5`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-6ac83612a5

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2021-12-16 01:12:07 UTC
FEDORA-2021-6ac83612a5 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.