diff options
author | Francis Rounds <Francis.Rounds@4bridgeworks.com> | 2016-09-14 11:53:51 +0000 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-09-15 14:05:04 +0200 |
commit | d2c5de0130d46e3314908cddb5f831a84a9f9e27 (patch) | |
tree | d82b95851a7ae360f4a9f0cd76b69dfd15a969ac /include/applets.src.h | |
parent | de1996dac516a49cd4c86270b918721f6e9f3f5d (diff) | |
download | busybox-d2c5de0130d46e3314908cddb5f831a84a9f9e27.tar.gz |
svlogd: strip leading '!' from processor lines
When using svlogd's processor functionality to run arbitrary commands
on log rotation, the line in the config is executed verbatim, i.e. the
exclamation mark is included.
For example, if the config file contains:
s100
!cat
then when it's time to rotate the log files after each 100 bytes, sh -c
"!cat" will be run, instead of sh -c "cat" as intended. The result is
svlogd logging
/bin/bash: !cat: command not found
svlogd: warning: processor failed, restart: /tmp/svlogd/
over and over again as it keeps attempting to execute the processor and
failing (unless you happen to have a "!cat" binary around :)).
Skipping the exclamation mark when performing the wstrdup() fixes the
issue.
Signed-off-by: Francis Rounds <francis.rounds@4bridgeworks.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include/applets.src.h')
0 files changed, 0 insertions, 0 deletions