RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1474814 - Permission denied when trying to access clamav-milter from postfix, through an UNIX socket.
Summary: Permission denied when trying to access clamav-milter from postfix, through a...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-25 12:39 UTC by Ugo Bellavance
Modified: 2017-07-25 17:33 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-07-25 13:34:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ugo Bellavance 2017-07-25 12:39:00 UTC
Description of problem:
When trying to access a milter (clamav-milter) from postfix, through an UNIX socket, I always get "permission denied"

Version-Release number of selected component (if applicable):
selinux-policy-3.13.1-102.el7_3.16.noarch

How reproducible:
Always

Steps to Reproduce:
1. Install the milter and its dependencies.
2. Configure the milter to listen to an UNIX socket (MilterSocket unix:/var/run/clamav-milter/clamav-milter.sock) and (re)start it. At this point, all is good.  The milter listens on the socket.
3. Configure postfix to access the milter through this socket, restart postfix.
4. Test sending an email.

Actual results:
warning: connect to Milter service unix:/var/run/clamav-milter/clamav-milter.sock: Permission denied
NOQUEUE: milter-reject: CONNECT from atq-vg-1.atqlan.agri-tracabilite.qc.ca[192.168.0.181]: 451 4.7.1 Service unavailable - try again later; proto=SMTP

Expected results:
Accepts the message

Additional info:
It's not SELinux related because the problem occurs even with setenforce=0. It's not even a real permission problem because it occurs even after a chmod 700 on the socket file. I know clamav-milter is not supported by Red Hat, but I don't think the 'permission denied' occurs, even with chmod 777:

# getfacl /var/run/clamav-milter/clamav-milter.sock
getfacl: Removing leading '/' from absolute path names
# file: var/run/clamav-milter/clamav-milter.sock
# owner: clamilt
# group: clamilt
user::rwx
group::rwx
other::rwx

I also tried setting the owner of the socket file to postfix. Still not good.

Comment 2 Petr Lautrbach 2017-07-25 13:34:10 UTC
(In reply to Ugo Bellavance from comment #0)
> Description of problem:
> When trying to access a milter (clamav-milter) from postfix, through an UNIX
> socket, I always get "permission denied"
> 
> Version-Release number of selected component (if applicable):
> selinux-policy-3.13.1-102.el7_3.16.noarch
> 
> How reproducible:
> Always
> 
> Steps to Reproduce:
> 1. Install the milter and its dependencies.
> 2. Configure the milter to listen to an UNIX socket (MilterSocket
> unix:/var/run/clamav-milter/clamav-milter.sock) and (re)start it. At this
> point, all is good.  The milter listens on the socket.
> 3. Configure postfix to access the milter through this socket, restart
> postfix.
> 4. Test sending an email.
> 
> Actual results:
> warning: connect to Milter service
> unix:/var/run/clamav-milter/clamav-milter.sock: Permission denied
> NOQUEUE: milter-reject: CONNECT from
> atq-vg-1.atqlan.agri-tracabilite.qc.ca[192.168.0.181]: 451 4.7.1 Service
> unavailable - try again later; proto=SMTP
> 
> Expected results:
> Accepts the message
> 
> Additional info:
> It's not SELinux related because the problem occurs even with setenforce=0.

Ok, closing as NOTABUG

> It's not even a real permission problem because it occurs even after a chmod
> 700 on the socket file. I know clamav-milter is not supported by Red Hat,
> but I don't think the 'permission denied' occurs, even with chmod 777:
> 
> # getfacl /var/run/clamav-milter/clamav-milter.sock
> getfacl: Removing leading '/' from absolute path names
> # file: var/run/clamav-milter/clamav-milter.sock
> # owner: clamilt
> # group: clamilt
> user::rwx
> group::rwx
> other::rwx
> 

What about the underlying directory?

# ls -ld /var/run/clamav-milter              
drwx--x---. 2 clamilt clamilt 40 Jul 25 15:27 /var/run/clamav-milter

Comment 3 Ugo Bellavance 2017-07-25 13:38:24 UTC
Thanks for your quick answer.

I know it is not an SELinux bug, but what component should I choose?

ll /var/run/clamav-milter/ -d
drwx--x---. 2 clamilt clamilt 40 Jul 25 08:50 /var/run/clamav-milter/

Comment 4 Ugo Bellavance 2017-07-25 17:33:22 UTC
You were right, permissions on the parent folder.  I'll figure it out.  Sorry for the noise.


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