tizen: Set AmbientCapabilities in user@.service
authorŁukasz Stelmach <l.stelmach@samsung.com>
Tue, 28 Jun 2022 13:31:24 +0000 (15:31 +0200)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Mon, 12 Feb 2024 15:37:49 +0000 (16:37 +0100)
commit6ce20e1345a5d48089512229188cf76bae4255f3
tree9c95ce66c8664199f05617edc61f68f5c9f0ae12
parent53484abda4c123e481d3df14f2dbe914772d58e9
tizen: Set AmbientCapabilities in user@.service

Replace obsolete Capabilities option in user@.service with
AmbientCapabilities to provide appropriate set of capabilties for systemd
to manage user session.

According to capability set transformation rules described in
capabilities(7)

    if a process with nonzero user IDs performs an execve(2) then any
    capa‐ bilities that are present in its permitted and effective
    sets will be cleared.

This means that for systemd running with nonzero UID (i.e. as the user
session manager) to keep permitted and effective capability
sets non-empty without setting file capabilities for systemd it is
required to use ambient capabilities.

Using file capabilities for systemd may be a wrong choice in the long
term, because different sets of capabilities may be assigned to different
user sessions.

Change-Id: I479fbbcf153737dbf88340ef4eb4be15d707a9a4
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
units/user@.service.in