Bug 2095381

Summary: [RFE] cyrus-imapd user systemd-sysusers
Product: Red Hat Enterprise Linux 9 Reporter: Pat Riehecky <riehecky>
Component: cyrus-imapdAssignee: Martin Osvald 🛹 <mosvald>
Status: CLOSED ERRATA QA Contact: František Hrdina <fhrdina>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: CentOS StreamCC: bstinson, cglombek, dtardon, fhrdina, jwboyer
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cyrus-imapd-3.4.1-10.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-07 08:36:44 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:
Bug Depends On: 2139054, 2217149, 2225157    
Bug Blocks:    

Description Pat Riehecky 2022-06-09 16:52:53 UTC
Description of problem:
cyrus-imapd is using static useradd scripts

Version-Release number of selected component (if applicable):
cyrus-imapd-3.4.1-6.el9.src.rpm

How reproducible:
100%

Steps to Reproduce:
1. review %pre
2.
3.

Actual results:
%pre
# Create 'cyrus' user on target host
getent group saslauth >/dev/null || /usr/sbin/groupadd -g %gid -r saslauth
getent passwd cyrus >/dev/null || /usr/sbin/useradd -c "Cyrus IMAP Server" -d /var/lib/imap -g %cyrusgroup \
  -G saslauth -s /sbin/nologin -u %uid -r %cyrususer

Expected results:
use of system-sysusers 

Additional info:
https://www.freedesktop.org/software/systemd/man/systemd-sysusers.html
https://fedoraproject.org/wiki/Changes/Adopting_sysusers.d_format

Comment 2 Martin Osvald 🛹 2022-11-03 07:21:39 UTC
This cannot be implemented without fixing sysusers.generate-pre.sh script first:

https://src.fedoraproject.org/rpms/systemd/pull-request/94

Comment 6 David Tardon 2023-07-25 08:16:00 UTC
(In reply to Pat Riehecky from comment #0)
> Description of problem:
> cyrus-imapd is using static useradd scripts

And why is that a problem? The only advantage of systemd-sysusers--as used in rpm scriptlets--is that the command lines are shorter. But that's hardly a sufficient reason for backporting such changes to existing releases (either of RHEL or Fedora)...

Comment 7 Christian Glombek 2023-07-25 11:55:10 UTC
This is a problem because static useradd scripts are incompatible with `rpm-ostree compose`, which consumes the declarative sysusers config snippets.

Using a sysusers config has been mandated by the Fedora Packaging Guidelines for a while now:
https://docs.fedoraproject.org/en-US/packaging-guidelines/UsersAndGroups/

More context:
https://fedoraproject.org/wiki/Changes/Adopting_sysusers.d_format
https://github.com/coreos/fedora-coreos-tracker/issues/1208

Comment 14 errata-xmlrpc 2023-11-07 08:36:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (cyrus-imapd bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6540