Made space handelers check that G_DOSCRIPTLINKS is enabled before running.
Its scary to think that a redraw space handeler could run
  import os
  os.system('rm -rf ~/')
removing all user files, Just by opening the blend file!
This means at least you can opt not to run any python scripts you dont want to..
			
			
This commit is contained in:
		@@ -1247,9 +1247,9 @@ int BPY_do_spacehandlers( ScrArea *sa, unsigned short event,
 | 
			
		||||
{
 | 
			
		||||
	ScriptLink *scriptlink;
 | 
			
		||||
	int retval = 0;
 | 
			
		||||
 | 
			
		||||
	if (!sa) return 0;
 | 
			
		||||
 | 
			
		||||
	
 | 
			
		||||
	if (!sa || !(G.f & G_DOSCRIPTLINKS)) return 0;
 | 
			
		||||
	
 | 
			
		||||
	scriptlink = &sa->scriptlink;
 | 
			
		||||
 | 
			
		||||
	if (scriptlink->totscript > 0) {
 | 
			
		||||
 
 | 
			
		||||
@@ -322,7 +322,7 @@ static void  script_panel_scriptlink(void)
 | 
			
		||||
 | 
			
		||||
	uiDefButBitI(block, TOG, G_DOSCRIPTLINKS, REDRAWBUTSSCRIPT,
 | 
			
		||||
			"Enable Script Links", xco, 200, 150, 20, &G.f, 0, 0, 0, 0,
 | 
			
		||||
			"Enable execution of all assigned Script links");
 | 
			
		||||
			"Enable execution of all assigned Script links amd Space Handelers");
 | 
			
		||||
	/* for proper alignment: */
 | 
			
		||||
	uiDefBut(block, LABEL, 0, "",	160, 200,150,20, NULL, 0.0, 0.0, 0, 0, "");
 | 
			
		||||
	
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user