aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wslua
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2019-02-06 13:32:51 +0100
committerPeter Wu <peter@lekensteyn.nl>2019-02-07 10:29:01 +0000
commit10ef8b717cb95929d81e4015515dc87fc8c8fc48 (patch)
treecfdb25411b8c7bf64c0c1255a64cc91dbad17eb6 /epan/wslua
parentb54c9b62e8e382a5b80da4f4a817cf4fc403c522 (diff)
wslua: do not load console.lua when run as root
dofile is currently disabled whenever Wireshark or tshark was started as root, calling it will result in Lua errors on startup. Even if dofile were not disabled, the Lua Evaluate menu option enables arbitrary Lua code execution. The other options (Console, help links) are not that important either, so just disable it when run as root. Change-Id: I0785fe9b3d4678d71ae1e0178811dada471c3525 Link: https://www.wireshark.org/lists/wireshark-dev/201902/msg00004.html Reviewed-on: https://code.wireshark.org/review/31912 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'epan/wslua')
-rw-r--r--epan/wslua/template-init.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/epan/wslua/template-init.lua b/epan/wslua/template-init.lua
index a06f62265e..3d83a2d2b7 100644
--- a/epan/wslua/template-init.lua
+++ b/epan/wslua/template-init.lua
@@ -130,5 +130,7 @@ datafile_path = Dir.global_config_path
persconffile_path = Dir.personal_config_path
-dofile(DATA_DIR.."console.lua")
+if not running_superuser or run_user_scripts_when_superuser then
+ dofile(DATA_DIR.."console.lua")
+end
--dofile(DATA_DIR.."dtd_gen.lua")