core: merge the second CapabilityBoundingSet= lines by AND when it is prefixed with...
authoriplayinsun <iplayinsun@gmail.com>
Mon, 4 Sep 2017 03:12:27 +0000 (12:12 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 4 Sep 2017 03:12:27 +0000 (12:12 +0900)
commitc792ec2e3512a672881fc847ff432e26b641c9c9
tree1a8c88620405bcf586dd505825f71632e21f6cdb
parent6b3c9ead190a06b84168462c89855a626ccb13a5
core: merge the second CapabilityBoundingSet= lines by AND when it is prefixed with tilde (#6724)

If a unit file contains multiple CapabilityBoundingSet= or
AmbientCapabilities= lines, e.g.,
===
CapabilityBoundingSet=CAP_A CAP_B
CapabilityBoundingSet=~CAP_B CAP_C
===
before this commit, it results all capabilities except CAP_C are set to
CapabilityBoundingSet=, as each lines are always merged by OR.
This commit makes lines prefixed with ~ are merged by AND. So, for the
above example only CAP_A is set.
This makes easier to drop capabilities with drop-in config files.
src/core/load-fragment.c