pve-manager/PVE
Fabian Grünbichler 58f763e1aa fix #3430: handle hook script paths better
if passing the hook script command as string, it might get interpreted
as shell command with side-effects. this is pretty harmless, since only
root is allowed to set the script parameter anyway, but making it more
robust and future-proof does not hurt.

tested with a reproducer of "/bin/echo $(touch $(whoami))" as script
parameter, with a file with that name existing, being executable and
having the following contents:

----8<----
echo "hello from hook script"
---->8----

without this change, the hookscript itself is not executed, but
'/bin/sh -c "/bin/echo $(touch $(whoami)) job"' and similar calls are,
which cause the file 'root' to be touched in the current working
directory of the vzdump process (or task worker).

with this change, the file is executed as is without any side-effects of
shell commands in the file name, and the 'hello from hook script' lines
are printed whenever the hook script is called by vzdump.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-05-17 09:49:34 +02:00
..
API2 api: pools: fix typo/syntax error 2021-05-10 17:12:17 +02:00
Ceph ceph: code/indentation cleanup 2021-05-03 14:03:32 +02:00
CLI pveceph: fixup syntax issue 2021-05-03 14:38:16 +02:00
Service proxy: fix wildcard address use 2021-05-07 18:15:43 +02:00
Status metrix: influx: fix default api_prefix 2021-03-15 15:28:11 +01:00
.gitignore add .gitignore files, fix Makefiles 2011-08-23 16:23:46 +02:00
API2.pm use PVE::DataCenterConfig 2019-11-18 12:25:35 +01:00
API2Tools.pm api: resources: return plugin type 2020-11-24 23:01:54 +01:00
APLInfo.pm aplinfo: use aplinfo signed with 6.x release key 2019-07-19 19:19:07 +02:00
AutoBalloon.pm avoid perl warning 2013-01-22 11:44:41 +01:00
CertCache.pm takeover CertCache from pve-cluster 2019-11-18 12:25:35 +01:00
CertHelpers.pm renew pve-ssl.pem when it nearly expires 2019-11-26 13:13:04 +01:00
ExtMetric.pm status/plugin: extend send/_connect/_disconnect/test_connection 2021-01-28 17:32:23 +01:00
HTTPServer.pm http server: comment and refactor CSRF skip-check logic 2021-04-22 11:19:40 +02:00
Makefile takeover CertCache from pve-cluster 2019-11-18 12:25:35 +01:00
NodeConfig.pm node_config: followup s/domain/alias 2020-06-25 10:28:14 +02:00
pvecfg.pm.in pvecfg: adapt version and release semantic 2019-05-26 16:11:43 +02:00
Report.pm report: top: also print command line arguments 2021-05-11 16:27:30 +02:00
VZDump.pm fix #3430: handle hook script paths better 2021-05-17 09:49:34 +02:00