[systemd-bugs] [Bug 85255] New: systemd will change permission of /dev/null when using User=, ExecStop= with StandardInput=tty

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Oct 20 11:51:11 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=85255

            Bug ID: 85255
           Summary: systemd will change permission of /dev/null when using
                    User=, ExecStop= with StandardInput=tty
           Product: systemd
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
          Assignee: systemd-bugs at lists.freedesktop.org
          Reporter: bernat at luffy.cx
        QA Contact: systemd-bugs at lists.freedesktop.org

Hi!

With the following unit:

[Unit]
Description = XBMC Media Center
After = remote-fs.target
After = syslog.target

[Service]
User = xbmc
Group = xbmc
Type = simple
Restart = always
RestartSec = 15
ExecStart = /bin/sleep 3600
ExecStop = /bin/sleep 2
TTYPath = /dev/tty9
StandardInput = tty
StandardOutput = journal

[Install]
WantedBy = multi-user.target

On stop, systemd will change permissions of /dev/null to user xbmc:

crw--w---- 1 xbmc root 1, 3 Oct 19 12:57 /dev/null

systemd 215 (as in Debian Jessie)

Looking at the source code, I suppose the culprit could be exec_spawn()
function (called with ExitStop), checking context->user (true) and checking if
context->std_input is a terminal, which should not be the case for ExecStop
since only the ExecStart process will be leader of the terminal. I suppose
ExecStop stdin is linked to /dev/null.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20141020/3d0f0593/attachment.html>


More information about the systemd-bugs mailing list