Skip to content

*Directory= directives override *Paths= directives #7070

@injust

Description

@injust

Submission type

Bug report

systemd version the issue has been seen with

235

Used distribution

Arch Linux

Unexpected behaviour you saw

RuntimeDirectory= and similar directives, e.g. CacheDirectory= and LogsDirectory=, override the directives InaccessiblePaths=, ReadOnlyPaths=, and ReadWritePaths=. This was introduced in version 235; bug cannot be replicated in version 234.

In case of bug report: Steps to reproduce the problem

Given a service file that writes to /var/log/test:

Does not work

InaccessiblePaths=/

Works, InaccessiblePaths= is overridden by RuntimeDirectory=

InaccessiblePaths=/
RuntimeDirectory=test

Does not work, CacheDirectory= overrides ReadWritePaths=

CacheDirectory=test
ProtectSystem=strict
ReadWritePaths=/var/log/test

Does not work, similar to case above

RuntimeDirectory=test
ProtectSystem=strict
ReadWritePaths=/var/log/test

Works because LogsDirectory= whitelists /var/log/test

LogsDirectory=test
ProtectSystem=strict
ReadWritePaths=/var/log/test

Works because ReadWritePaths= is not overridden

ProtectSystem=strict
ReadWritePaths=/var/log/test

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Programming errors, that need preferential fixingpid1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions