Bug 89248

Summary: SocketMode directive is "partially" ignored (bug/or lack of documentation)
Product: systemd Reporter: Davide Bettio <davide.bettio>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Proposed fix

Description Davide Bettio 2015-02-20 23:03:11 UTC
How to reproduce this bug:

use: SocketMode=0777

result:
srwxr-xr-x 1 myuser mygroup 0 Feb 20 22:42 /var/run/mysocket

it looks like the following code is executed:

/* Enforce the right access mode for the socket */
old_mask = umask(~ socket_mode);

/* Include the original umask in our mask */
umask(~socket_mode | old_mask);

Fix:
Either remove umask(~socket_mode | old_mask) or document this behavior.
Comment 1 Davide Bettio 2015-02-20 23:04:35 UTC
Created attachment 113705 [details]
Proposed fix
Comment 2 Lennart Poettering 2015-05-15 14:37:59 UTC
You are right, we probably should not consider the umask in this case.

Applied:

http://cgit.freedesktop.org/systemd/systemd/commit/?id=a2c7f25aec23b6d74ff5cf169e38159754e6dfe8

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.