diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-01-09 01:06:28 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-01-28 19:32:25 +0000 |
commit | ff9592166828721e0f394571ab7c0d82036e9049 (patch) | |
tree | aede2826e2403a7dbb773e1e7ce6d8d169a40a39 /src/common/notify.cpp | |
parent | common: set MONERO_DEFAULT_LOG_CATEGORY for notify and spawn (diff) | |
download | monero-ff9592166828721e0f394571ab7c0d82036e9049.tar.xz |
notify: warn if the spec contains one of '"\
These aren't processed as a shell does, so this may surprise users
Diffstat (limited to 'src/common/notify.cpp')
-rw-r--r-- | src/common/notify.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/notify.cpp b/src/common/notify.cpp index 533debe71..0ac3d501b 100644 --- a/src/common/notify.cpp +++ b/src/common/notify.cpp @@ -49,6 +49,8 @@ Notify::Notify(const char *spec) boost::split(args, spec, boost::is_any_of(" ")); CHECK_AND_ASSERT_THROW_MES(args.size() > 0, "Failed to parse spec"); + if (strchr(spec, '\'') || strchr(spec, '\"') || strchr(spec, '\\')) + MWARNING("A notification spec contains a quote or backslash: note that these are handled verbatim, which may not be the intent"); filename = args[0]; CHECK_AND_ASSERT_THROW_MES(epee::file_io_utils::is_file_exist(filename), "File not found: " << filename); } |