]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev-rules: all values can contain escaped double quotes now (#6890)
authorFranck Bui <fbui@suse.com>
Thu, 28 Sep 2017 06:53:46 +0000 (08:53 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 28 Sep 2017 06:53:46 +0000 (08:53 +0200)
commit7e760b79ad143b26a5c937afa7666a7c40508f85
tree50a8c8572193f84298beeacde87c8399db1cc875
parent9500b9209beea95b9fbbfb0c2ffaf0cd0277da71
udev-rules: all values can contain escaped double quotes now (#6890)

This is primarly useful to support escaped double quotes in PROGRAM or
IMPORT{program} directives.

The only possibilty before this patch was to use an external shell script but
this seems too cumbersome for trivial logics such as

 PROGRAM=="/bin/sh -c 'FOO=\"%s{model}\"; echo ${FOO:0:4}'"

or any similar shell constructs that needs to deals with patterns including
whitespaces.

As it's the case for single quote and for directives running a program, words
within escaped double quotes will be considered as a single argument.

Fixes: #6835
src/udev/udev-event.c
src/udev/udev-rules.c
test/udev-test.pl