Add tags to svn:ignore
[obnox/wireshark/wip.git] / template-init.lua
1 -- init.lua
2 --
3 -- initilaize ethereal's lua
4 --
5 --  This file is going to be executed before any other lua script.
6 --  It can be used to load libraries, disable functions and more.
7 --
8 -- $Id: $
9 -- 
10 -- Ethereal - Network traffic analyzer
11 -- By Gerald Combs <gerald@ethereal.com>
12 -- Copyright 1998 Gerald Combs
13 --
14 -- This program is free software; you can redistribute it and/or
15 -- modify it under the terms of the GNU General Public License
16 -- as published by the Free Software Foundation; either version 2
17 -- of the License, or (at your option) any later version.
18 --
19 -- This program is distributed in the hope that it will be useful,
20 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
21 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 -- GNU General Public License for more details.
23 --
24 -- You should have received a copy of the GNU General Public License
25 -- along with this program; if not, write to the Free Software
26 -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
27
28
29 -- If lua is to be disabled even if it was installed uncomment the following
30 -- line.
31 -- disable_lua = true; do return end;
32
33
34 -- If set and we are running with special privileges this setting
35 -- tells whether scripts other than this one are to be run.
36 run_user_scripts_when_superuser = false
37
38 -- disable potentialy harmful lua functions when running superuser
39 if running_superuser then
40     dofile = function() error("dofile has been disabled") end
41     loadfile = function() error("loadfile has been disabled") end
42     loadlib = function() error("loadlib has been disabled") end
43     require = function() error("require has been disabled") end
44     os = {}
45     io = {}
46     file = {}
47 end
48
49 -- to avoid output to stdout which can caause problems lua's print ()
50 -- has been suppresed so that it yields an error.
51 -- have print() call info() instead.
52 print = info
53
54 -- %WTAP_ENCAPS%
55
56 -- %FT_TYPES%
57
58