]> code.ossystems Code Review - openembedded-core.git/commit
systemd: escape paths passed to shell
authorDamien Riegel <damien.riegel@savoirfairelinux.com>
Fri, 22 Jun 2018 18:43:02 +0000 (14:43 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 27 Jun 2018 12:54:18 +0000 (13:54 +0100)
commitbbd9524256461f1bcafd4103edd575e668de76f8
treed24323133c6d9d765d42abc571c2cf185b3aa32c
parent68e0080a924654245f04cf92c2579abd9e5bc658
systemd: escape paths passed to shell

Systemd mount configuration file must have a name that match the mount
point directory they control. So for instance, if a mount file contains

    [Mount]
    ...
    Where=/mnt/my-data

The file must be named `mnt-my\x2ddata.mount`, or systemd will refuse to
honour it.

If this config file contains an [Install] section, it will silently fail
because the unit file is not escaped properly when systemctl is called.
To fix that, make sure paths are escaped through `shlex.quote`.

Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/systemd.bbclass