secured exec context for mdl's cfgs (and pre package auto-downloader work ?)

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6631 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lucas GAUTHERON
2011-09-01 21:49:57 +00:00
parent ffea7f5556
commit eb426f8cd3
3 changed files with 8 additions and 3 deletions
+4 -1
View File
@@ -5,16 +5,19 @@
context_core = 0 // hardcoded scripts
context_cfg = 1 // known scripts
context_prompt = 2 // command prompt
context_mapcfg = 3 // map configs, we don't trust them
context_mdlcfg = 4 // mdl configs, same
// set allowed commands for the map config context
mapcfgidents = [ loadnotexture loadsky mapmodelreset mapmodel texturereset texture fog fogcolour mapsoundreset mapsound watercolour shadowyaw ]
mdlcfgidents = [ md2anim md2emit md2tag md3anim md3emit md3link md3load md3skin mdlalphatest mdlcachelimit mdlcullface mdlscale mdlshadowdist mdltrans mdltranslucent mdlvertexlight]
loop i (listlen $mapcfgidents) [ scriptcontext $context_mapcfg (at $mapcfgidents $i) ]
loop i (listlen $mdlcfgidents) [ scriptcontext $context_mdlcfg (at $mdlcfgidents $i) ]
// isolate the map config context
// this disables access from this context to identifiers located in other contexts
// also it removes all aliases created in this context once the running context changes
isolatecontext $context_mapcfg
isolatecontext $context_mdlcfg
// secure this configuration for the rest of the game
sealcontexts