Bug 2125904 - unable to change shells using sudo lchsh
Summary: unable to change shells using sudo lchsh
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: libuser
Version: 37
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Tomas Halman
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-11 17:38 UTC by grumpey0
Modified: 2022-09-23 18:17 UTC (History)
2 users (show)

Fixed In Version: libuser-0.63-13.fc38
Clone Of:
Environment:
Last Closed: 2022-09-23 18:17:58 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SSSD-5058 0 None None None 2022-09-22 15:15:56 UTC

Description grumpey0 2022-09-11 17:38:24 UTC
Description of problem:
Unable to change shells using lchsh

Version-Release number of selected component (if applicable):
0.63-12.fc37

How reproducible:
Every time.

Steps to Reproduce:
1. sudo lchsh username
2.
3.

Actual results:
[grumpey@grumpey0 ~]$ sudo lchsh grumpey
[sudo] password for grumpey: 
Changing shell for ��)\.
User @�I��U does not exist.

Expected results:
Being prompted to change shell for user

Comment 1 grumpey0 2022-09-13 01:20:47 UTC
- This looks likes it is related to: https://bugzilla.redhat.com/show_bug.cgi?id=2100287

With popt-1.19~rc1-4
sudo lid grumpey
/etc/login.defs does not exist

sudo luseradd grumpey2
Error creating group `/etc/login.defs': name contains invalid char `/'

Downgrading from popt-1.19~rc1-4.fc37.x86_64 to popt-1.19~rc1-3.fc37.x86_64 appears to make things work.

Comment 2 Tomas Halman 2022-09-22 15:08:31 UTC
The popt context is freed too early and pointers to parameters are used later. Older popt library actually leaked memory so it worked.

Looking at the code I can confirm that this is bug in libuser and how it uses popt. Probably moving the poptFreeContext(popt) to the end of
the main() will solve the issue. The bug affects more libuser's utilities, not just lchsh.

Tomas

Comment 3 Fedora Update System 2022-09-23 18:16:08 UTC
FEDORA-2022-358fda7efe has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2022-358fda7efe

Comment 4 Fedora Update System 2022-09-23 18:17:58 UTC
FEDORA-2022-358fda7efe has been pushed to the Fedora 38 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.