From a9ef69947241e08a800ce91c884b073ee96d911a Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 9 Jan 2019 01:06:28 +0000 Subject: [PATCH] notify: warn if the spec contains one of '"\ These aren't processed as a shell does, so this may surprise users --- src/common/notify.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/notify.cpp b/src/common/notify.cpp index 2a8228283..c68634ada 100644 --- a/src/common/notify.cpp +++ b/src/common/notify.cpp @@ -47,6 +47,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); }