Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 643612 - mail-mta/postfix sets up /var/spool/postfix as owned by postfix instead of root
Summary: mail-mta/postfix sets up /var/spool/postfix as owned by postfix instead of root
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Net-Mail Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-05 21:41 UTC by faminebadger
Modified: 2018-02-06 13:52 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description faminebadger 2018-01-05 21:41:15 UTC
The postfix ebuild creates a new user, postfix, with home folder at /var/spool/postfix, thus:

> pkg_setup() {
> 	# Add postfix, postdrop user/group (bug #77565)
> 	enewgroup postfix 207
> 	enewgroup postdrop 208
> 	enewuser postfix 207 -1 /var/spool/postfix postfix,mail
> }

Which we can confirm from /etc/passwd:

> famine@gentoo ~ (0) $ grep postfix /etc/passwd
> postfix:x:207:207:added by portage for postfix:/var/spool/postfix:/sbin/nologin

Which results in postfix owning the folder:

> famine@gentoo ~ (0) $ ls -ld /var/spool/postfix/
> drwxr-xr-x 16 postfix root 424 Dec 18 00:33 /var/spool/postfix/

However, postfix itself doesn't like this arrangement and complains about it to the syslog at every boot:

> famine@gentoo ~ (0) $ sudo postfix check
> postfix/postfix-script: warning: not owned by root: /var/spool/postfix/.

So - the program says this folder should be owned by root, but the ebuild creates the postfix user with its home folder here (and hence postfix ends up owning it).

These two things are in conflict - to have a user's home folder not owner by that user is non-sensical (and I'm nervous therefore to change its ownership from postfix:root to root:postfix).

The ebuild probably needs to be updated to create a structure that postfix is happy with (perhaps creating /var/spool/postfix/home as the home folder?).
Comment 1 Eray Aslan gentoo-dev 2018-01-08 14:45:34 UTC
Please check postfix-3.3_pre20180107.  Leaving the bug open for now as postfix-3.3 releases are masked
Comment 2 Larry the Git Cow gentoo-dev 2018-02-06 13:52:02 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e698393252aa139b3196f01bac2e8b6a855338f0

commit e698393252aa139b3196f01bac2e8b6a855338f0
Author:     Eray Aslan <eras@gentoo.org>
AuthorDate: 2018-02-06 12:57:05 +0000
Commit:     Eray Aslan <eras@gentoo.org>
CommitDate: 2018-02-06 13:51:31 +0000

    mail-mta/postfix: bump to 3.2.5
    
    and fix permissions for first time installs
    Closes: https://bugs.gentoo.org/643612
    Package-Manager: Portage-2.3.24, Repoman-2.3.6

 mail-mta/postfix/Manifest             |   1 +
 mail-mta/postfix/postfix-3.2.5.ebuild | 301 ++++++++++++++++++++++++++++++++++
 2 files changed, 302 insertions(+)