]> git.ipfire.org Git - thirdparty/chrony.git/commit
examples: replace grep command in NM dispatcher script
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 23 Mar 2022 14:17:03 +0000 (15:17 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 23 Mar 2022 14:36:17 +0000 (15:36 +0100)
commitfca8966adaaf8376536af86ba2afe02501463588
tree625944fa303e5982473d3a5e3ad067b1eeed3ef7
parent25f80a1a9d134e37173ab7f8a2c0d822e75fd2e1
examples: replace grep command in NM dispatcher script

Some grep implementations detect binary data and return success without
matching whole line. This might be an issue for the DHCPv6 NTP FQDN
check. The GNU grep in the C locale seems to check only for the NUL
character, which cannot be passed in an environment variable, but other
implementations might behave differently and there doesn't seem to be a
portable way to force matching the whole line.

Instead of the grep command, check for invalid characters by comparing
the length of the input passed through "tr -d -c".
examples/chrony.nm-dispatcher.dhcp