View Single Post
11-24-15, 05:27 PM   #1
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Bagnon causes restricted environment lock?

I'm currently using some table manipulation inside the secure environment, where I gather unit frames by recursively scanning the UIParent and inserting all protected frames with a unit attribute assigned into a restricted table.

This works flawlessly - until I open interface settings. After that, attempting to run the snippet that gathers nodes results in this error:
Lua Code:
  1. 1x FrameXML\RestrictedExecution.lua:397: Call failed: FrameXML\RestrictedExecution.lua:397: Call failed: FrameXML\RestrictedExecution.lua:397: Call failed: FrameXML\RestrictedInfrastructure.lua:365: Cannot create restricted tables from insecure code
  2. [C]: ?
  3. FrameXML\RestrictedExecution.lua:397: in function <FrameXML\RestrictedExecution.lua:390>
  4. (tail call): ?
  5. (tail call): ?
  6. FrameXML\SecureHandlers.lua:283: in function <FrameXML\SecureHandlers.lua:277>
  7. (tail call): ?
  8.  
  9. Locals:
  10. workingEnv = <userdata>
  11. ctrlHandle = <userdata>
  12. pcallFlag = false
  13. LOCAL_Function_Environment_Manager = <function> defined @FrameXML\RestrictedExecution.lua:209
  14. error = <function> defined =[C]:-1
  15. tostring = <function> defined =[C]:-1

Naturally, I turned to the trustworthy taint log to see what the hell happend. After sifting through all the bloat I found this:
Code:
11/25 00:02:09.812  Execution tainted by Bagnon while reading BagnonFrameinventory - Interface\FrameXML\UIParent.lua:2784
11/25 00:02:09.812      securecall()
11/25 00:02:09.812      Interface\FrameXML\UIParent.lua:2824 CloseWindows()
11/25 00:02:09.812      Interface\FrameXML\UIParent.lua:2852
11/25 00:02:09.812      securecall()
11/25 00:02:09.812      Interface\FrameXML\UIParent.lua:3532 ToggleGameMenu()
11/25 00:02:09.812      TOGGLEGAMEMENU:1
11/25 00:02:09.812  Execution tainted by Bagnon while reading BagnonFrameinventory - Interface\FrameXML\UIParent.lua:2784
11/25 00:02:09.812      securecall()
11/25 00:02:09.812      Interface\FrameXML\UIParent.lua:2824
11/25 00:02:09.812      securecall()
11/25 00:02:09.812      Interface\FrameXML\UIParent.lua:1966 <unnamed>:ShowUIPanel()
11/25 00:02:09.812      Interface\FrameXML\UIParent.lua:1880
11/25 00:02:09.812      <unnamed>:SetAttribute()
11/25 00:02:09.812      Interface\FrameXML\UIParent.lua:2630 ShowUIPanel()
11/25 00:02:09.812      Interface\FrameXML\UIParent.lua:3543 ToggleGameMenu()
11/25 00:02:09.812      TOGGLEGAMEMENU:1
By disabling Bagnon, the errors disappear and I can continue to securely manipulate tables after opening the interface settings. So far, I've had no taint issues with Bagnon, but attempting to manipulate tables after viewing the interface settings seems to cause a complete meltdown.

So what I'm really asking here is:
  1. Can I prevent this from happening or is the problem only related to Bagnon?
  2. Can I determine whether I'm running a tainted execution path and thereby circumvent the lockdown?

Here's the actual code, but it's all executed within a secure enviroment and using secure buttons to trigger changes within.
It works regardless of combat state and hasn't broken down in any other scenario thus far.
__________________

Last edited by MunkDev : 11-24-15 at 06:12 PM.
  Reply With Quote