From 40a71e2aae7cd6f428f74a663a0782fe794e3343 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 28 Jul 2011 00:14:33 -0400 Subject: [PATCH] Feature #811 - Added feature #811, which makes the 'execute' command optional, and controlled by '#define HAVE_EXECUTE 1' in cmake.h. This allows a build that does not have the potential security hole, in the event that taskwarrior is run at elevated privilege, or run in the context of a web server. --- ChangeLog | 4 ++++ cmake.h.in | 2 ++ src/commands/Command.cpp | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 09df9cf51..265ae7d98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -85,6 +85,10 @@ + Added feature #800, adding a new command 'columns' that lists all the columns available for custom reports, and includes their formatting options (thanks to T. Charles Yun). + + Added feature #811, which makes the 'execute' command optional, and + controlled by '#define HAVE_EXECUTE 1' in cmake.h. This allows a build + that does not have the potential security hole, in the event that taskwarrior + is run at elevated privilege, or run in the context of a web server. # Tracked Bugs, sorted by ID. + Fixed bug #403, which disambiguates certain commands involving numbers. diff --git a/cmake.h.in b/cmake.h.in index 5b0478d10..a6d55731d 100644 --- a/cmake.h.in +++ b/cmake.h.in @@ -57,3 +57,5 @@ Override PACKAGE_LANGUAGE, then #cmakedefine HAVE_UUID #cmakedefine HAVE_UUID_UNPARSE_LOWER +#define HAVE_EXECUTE 1 + diff --git a/src/commands/Command.cpp b/src/commands/Command.cpp index b729f9ab2..536ae013e 100644 --- a/src/commands/Command.cpp +++ b/src/commands/Command.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -54,7 +55,9 @@ #include #include #include +#ifdef HAVE_EXECUTE #include +#endif #include #include #include @@ -119,7 +122,9 @@ void Command::factory (std::map & all) c = new CmdDone (); all[c->keyword ()] = c; c = new CmdDuplicate (); all[c->keyword ()] = c; c = new CmdEdit (); all[c->keyword ()] = c; +#ifdef HAVE_EXECUTE c = new CmdExec (); all[c->keyword ()] = c; +#endif c = new CmdExport (); all[c->keyword ()] = c; c = new CmdGHistoryMonthly (); all[c->keyword ()] = c; c = new CmdGHistoryAnnual (); all[c->keyword ()] = c;