]> git.ipfire.org Git - thirdparty/systemd.git/commit
rule-syntax-check: fix handling of runaway strings in comma splitting (#8298)
authorFilipe Brandenburger <filbranden@google.com>
Wed, 28 Feb 2018 00:11:38 +0000 (16:11 -0800)
committerEvgeny Vereshchagin <evvers@ya.ru>
Wed, 28 Feb 2018 00:11:38 +0000 (03:11 +0300)
commit27e2779beddd45ee22a5493b49ee9bc1cd0f844a
tree47f8134d5c9fe394dc5d2cf2aab2765ee41140f2
parent10eeab67aa6b098709b6ac0dcba5f647eab8fed3
rule-syntax-check: fix handling of runaway strings in comma splitting (#8298)

A runaway string should still be returned by the code that splits on
commas, so add a '?' to the regex so that the last '"?' in a string
still produces a valid block for the split code.

Tested:

  ACTION=="remove\"GOTO=""

Which then produced:

  $ test/rule-syntax-check.py src/login/70-uaccess.rules
  # looking at src/login/70-uaccess.rules
  Invalid line src/login/70-uaccess.rules:10: ACTION=="remove\"GOTO=""
    clause: ACTION=="remove\"GOTO=""
test/rule-syntax-check.py