Bug 89248 - SocketMode directive is "partially" ignored (bug/or lack of documentation)
Summary: SocketMode directive is "partially" ignored (bug/or lack of documentation)
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-20 23:03 UTC by Davide Bettio
Modified: 2015-05-15 14:37 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Proposed fix (565 bytes, text/plain)
2015-02-20 23:04 UTC, Davide Bettio
Details

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.