This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

dofile not loading when path is specified

0

Hi,

I have written a dissector and placed it in /home/me

I edited init.lua with dofile("/home/me/mydissector.lua") when i run wireshark i get Lua: Error During Loading

If i cd /home/me and run wireshak the dissector is loaded properly.

I am running Wireshark 1.4.1 & Lua 5.1 on CentOS 5.6 as root.

Thanks

asked 31 Aug '11, 17:17

mrb's gravatar image

mrb
16337
accept rate: 0%

edited 31 Aug '11, 17:35

There should be additional detail after "Error during loading". For example:

tshark: Lua: Error during loading:
 [string "dummy.lua"]:2: bad argument #1 to 'dofile' (dofile: file does not exist)

What is your full error message?

(31 Aug '11, 19:16) helloworld

One Answer:

0

just to check, if you have seen 'disable potentialy harmful lua functions when running superuser' comment in the init.lua?

there's a special check for running under root that disables dofile and other os related libraries.

if running_superuser then
    local disabled_lib = {}
    setmetatable(disabled_lib,{ __index = function() error("this package has been disabled") end } );
dofile = function() error("dofile has been disabled") end

… end

If you absolutely need to run wireshark as root then you can temporarly disable that check by adding say ‘0 and’ to if condition:

if 0 and running_superuser then
local disabled_lib = {}
…

answered 08 Nov ‘11, 20:26

ShomeaX's gravatar image

ShomeaX
736
accept rate: 0%