Bug 1989821 - /etc/mailman has wrong permissions 2755 instead of 2775, blocking "genaliases"
Summary: /etc/mailman has wrong permissions 2755 instead of 2775, blocking "genaliases"
Keywords:
Status: ASSIGNED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: mailman-2.1-module
Version: 8.4
Hardware: All
OS: Linux
unspecified
low
Target Milestone: beta
: ---
Assignee: Martin Osvald 🛹
QA Contact: František Hrdina
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-04 06:22 UTC by Peter Bieringer
Modified: 2023-08-15 06:47 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-02-04 07:27:46 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-92233 0 None None None 2021-08-04 06:25:21 UTC

Description Peter Bieringer 2021-08-04 06:22:53 UTC
This is related to 
https://bugzilla.redhat.com/show_bug.cgi?id=1229307
https://bugzilla.redhat.com/show_bug.cgi?id=1188043

Description of problem:
Can't generate new alias files as user "mailman", because /etc/mailman is not writable for that particular user


Version-Release number of selected component (if applicable):
mailman-2.1.29-11.module_el8.4.0+550+d42de55d.x86_64
mailman-2.1.34-3.fc34.x86_64.rpm (Fedora 34)

How reproducible:
Always


Steps to Reproduce:
1. su - -s /bin/bash mailman
2. /usr/lib/mailman/bin/genaliases

Actual results:
Traceback (most recent call last):
  File "/usr/lib/mailman/bin/genaliases", line 124, in <module>
    main()
  File "/usr/lib/mailman/bin/genaliases", line 112, in main
    MTA.create(mlist, nolock=True, quiet=quiet)
  File "/usr/lib/mailman/Mailman/MTA/Postfix.py", line 338, in create
    _do_create(mlist, VIRTFILE, _addvirtual)
  File "/usr/lib/mailman/Mailman/MTA/Postfix.py", line 325, in _do_create
    _check_for_virtual_loopaddr(mlist, textfile)
  File "/usr/lib/mailman/Mailman/MTA/Postfix.py", line 244, in _check_for_virtual_loopaddr
    outfp = open(filename + '.tmp', 'w')
IOError: [Errno 13] Permission denied: '/etc/mailman/virtual-mailman.tmp'


Expected results:
Working


Additional info:

EL8:
rpm -qlv mailman | grep -w /etc/mailman$
drwxr-sr-x    2 root    mailman                     0 Nov  3  2020 /etc/mailman

F34:
rpm -qlpv mailman-2.1.34-3.fc34.x86_64.rpm | grep -w /etc/mailman$ 
drwxr-sr-x    2 root     mailman                     0 Jan 27  2021 /etc/mailman


Workaround:
chmod g+w /etc/mailman

Comment 3 RHEL Program Management 2023-02-04 07:27:46 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 4 Martin Osvald 🛹 2023-04-02 13:49:36 UTC
Reopening this, this should have been fixed already by the below changes in versions 3:2.1.29-6 and 3:2.1.29-7, but it looks like a typo is behind 2755 instead of 2775 (the %changelog itself mentions that correctly):

3:2.1.29-6:
~~~
-Release: 5%{?dist}
+Release: 6%{?dist}
...
-# no need for setgid in configdir
-chmod %{buildroot}/%{configdir} -s -R
...
 %changelog
-* Thu Apr 23 2020 Pavel Zhukov <pzhukov> - 3:2.1.29-5
+* Thu Apr 23 2020 Pavel Zhukov <pzhukov> - 3:2.1.29-6
 - Update run directory references (#1805954)
+- fix #1188043 - set 2775 permission for /etc/mailman
~~~

3:2.1.29-7:
~~~
-Release: 6%{?dist}
+Release: 7%{?dist}
...
-%dir %attr(755,root,%{mmgroup}) %{configdir}
+%dir %attr(2755,root,%{mmgroup}) %{configdir}
...
+* Wed May  6 2020 Pavel Zhukov <pzhukov> - 3:2.1.29-7
+- Change attr of /etc/mailman
~~~

The +g right is needed as stated in RHEL7 bug 1188043 for /etc/mailman/aliases.tmp creation:

~~~
Actual results:
strace -e open shows:
open("/etc/mailman/aliases", O_RDONLY)  = 3
open("/etc/mailman/aliases.tmp", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 EACCES (Permission denied)
open("/var/lock/mailman/creator", O_RDONLY) = 3
~~~

Thanks for reporting this repeatedly.


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