On Wed, Aug 17, 2016 at 07:39:41AM +0200, Joerg Jung wrote:

My conclusions on this issue:

It seems on Linux that a process started as a user by another user (as done by opensmptd 
and dovecot to drop permissions to a non-privileged user) inherits by default only that 
user's primary group. Secondary groups (e.g. as defined in /etc/groups) are not inherited 
unless explicitly done so (see "man initgroups"). This isn't something I've 
dealt with before and didn't really understand.

The short of it is that to share the passwd file, either:

1. The file must be world-readable (not so good)

2. The opensmtpd and dovecot daemon users must share a primary group, or

3. The daemons must call initgroups() or something similar after dropping 
privileges.

4. The daemon reads the file before it drops privileges? Though would miss 
updates later...

Good point... I believe that's how opensmtpd currently handles SSL private keys.

Can you please open a bug report on github for this? Thanks!

I filed it as a feature request. FWIW, it turns out dovecot can already do this if you explicitly set the groups:

http://marc.info/?l=dovecot&m=133350196124100&w=2

Jeremy

--
You received this mail because you are subscribed to [email protected]
To unsubscribe, send a mail to: [email protected]

Reply via email to