IsDisabledByParentalControls Taint

90 Night Elf Rogue
5785
As of 5.4.1 BLizzard has added a call to the secure function C_StorePublic.IsDisabledByParentalControls() into their UpdateMicroButtons() function. Because UpdateMicroButtons is called during the OnShow and OnHide events of over 30 frames, anything that touches those frames will cause taint errors. This includes adding addon options to the interface panel.

To test this I created the following simple addon whose only purpose was to add an entry to the InterfaceOptions panel. I then disabled all other addons and opened WoW.

TestAddon.toc
## Interface: 50400
## Title: TestAddon
## Version: 2.0.50400
TestAddon.lua

TestAddon.lua
MyAddon.childpanel = CreateFrame( "Frame", "MyAddonChild", MyAddon.panel);
MyAddon.childpanel.name = "MyChild";
MyAddon.childpanel.parent = MyAddon.panel.name;
InterfaceOptions_AddCategory(MyAddon.childpanel);

At first I could open and close the WorldMap without error, however once I opened the interface option panel any attempt to open the WorldMap, or any other frame touched by this, threw the following error:

Error: AddOn TestAddon attempted to call a forbidden function (IsDisabledByParentalControls()) from a tainted execution path.

It is so bad that even macros that simply change a frames state (ie /run WorldMapFrame_ToggleWindowSize()) will cause this taint error to appear.

While code cleanup does solve some of the causes of this problem, I don't think addon authors are going to be able to eliminate it on their own. I believe Blizzard is going to have to fix their code by either changing C_StorePublic.IsDisabledByParentalControls() to a non-secure function, or by assigning its value to a variable when WoW loads and just reference that variable in UpdateMicroButtons().

** Update **
To clarify, once the InterfaceOptions panel is opened the WorldMapFrame may open once without error. However, from that point forward any attempt to open the WorldMap will throw a taint error.
Edited by Rotule on 10/30/2013 7:58 AM PDT
Reply Quote
MVP - Technical Support
100 Human Warrior
19545
Just to add to this. A lot of those functions still calling UpdateMicroButtons() shouldn't even be calling them anymore. Several of the functions calling UpdateMicroButtons haven't had a microbutton in ages. Map hasn't had one since like classic. Friends frame since who knows when. Buttons that were removed should have UpdateMicroButtons removed from respective functions.

This is workaround I'm using to "fix" problem (replace FriendsFrame_OnShow with whatever onshow you need to work with).

setfenv(FriendsFrame_OnShow, setmetatable({ UpdateMicroButtons = function() end }, { __index = _G }))
Credits to Nevcairiel for the work around.

There are other more intrusive global work arounds but they seem to have side effects like causing other taints. This seems to be only way to address issue for some mods though that have no choice like Nevcairel's Mapster addon.

Side effect of this work around will be minor, like the button icon not updating to show it depressed when that frame is open. Irrelevant for frames that don't even have buttons anymore in first place like map or social though. Those frames even calling microbutton updates is a bug that in itself.
Edited by Omegal on 10/29/2013 4:28 PM PDT
Reply Quote
100 Gnome Warrior
12815
The answer to taint issues is almost always "addon authors, deal with it", but Blizzard can you fix this? This is a particularly nasty source of taint.
Reply Quote
100 Draenei Shaman
20715

This is workaround I'm using to "fix" problem (replace FriendsFrame_OnShow with whatever onshow you need to work with).

setfenv(FriendsFrame_OnShow, setmetatable({ UpdateMicroButtons = function() end }, { __index = _G }))
Credits to Nevcairiel for the work around.

There are other more intrusive global work arounds but they seem to have side effects like causing other taints. This seems to be only way to address issue for some mods though that have no choice like Nevcairel's Mapster addon.

Side effect of this work around will be minor, like the button icon not updating to show it depressed when that frame is open. Irrelevant for frames that don't even have buttons anymore in first place like map or social though. Those frames even calling microbutton updates is a bug that in itself.


Note this proposed workaround ALSO has the side-effect of tainting the _OnShow function, which makes it unusable for any frames containing secure frames. Specifically, using this hack for RaidFrame_OnShow leads taint errors when you try to toggle the RaidFrame in combat. Similar problem if you try it for PlayerTalentFrame_OnShow. Even the shown example of FriendsFrame causes "Interface action failed because of an AddOn" errors when you toggle the FriendsFrame in combat. Other frames probably also suffer from this. This hack only happens to work for the MapFrame because it does not contain secure frame elements.

TLDR: there is no working solution on the addon side for many frames suffering from this new problem.
Edited by Ashel on 10/30/2013 4:01 AM PDT
Reply Quote
MVP - Technical Support
100 Human Warrior
19545
10/30/2013 03:57 AMPosted by Ashel
TLDR: there is no working solution on the addon side for many frames suffering from this new problem.

Far as I've seen, this shouldn't be affecting raid frames. I see point with other stuff though. For some things it may still be better than it was before. Social only tainting in combat is hardly an issue for example though. Not very likely to open it in combat vs out of combat.
These are all the frames affected.
https://github.com/tekkub/wow-ui-source/search?p=1&q=UpdateMicroButtons&ref=cmdform

There is a way to globally fix it with side effect, you can't ever change talents or glyphs. Just taint the blizz store function (and of course, COMPLETELY avoid the blizz store after that or it'll definitely explode).
/script C_StorePublic.IsDisabledByParentalControls = function() end

Not that it's any kind of solution for mods to use, merely posting for the sake of people who might want to get through this patch and know they won't be swapping talents that session.
Edited by Omegal on 10/30/2013 6:12 AM PDT
Reply Quote
Not that it's any kind of solution for mods to use, merely posting for the sake of people who might want to get through this patch and know they won't be swapping talents that session.
That's the "solution" I'm using for Dominos currently, until I can find a less destructive option.
Reply Quote
MVP - Technical Support
100 Human Warrior
19545
The solution is obvious to me, like op said, blizz could fix this in about 2 minutes worth of time. They could even leave the function protected. just don't call it in updatemicrobuttons. Call it on load/login and save the answer, and then just check THAT in UMB

So basically, this


local cantUseStore = C_StorePublic.IsDisabledByParentalControls()
function UpdateMicroButtons()
...
...
elseif ( cantUseStore ) then
StoreMicroButton.disabledTooltip = BLIZZARD_STORE_ERROR_PARENTAL_CONTROLS;
StoreMicroButton:Disable();
else
StoreMicroButton.disabledTooltip = nil;
StoreMicroButton:Enable();
end
end


instead of


function UpdateMicroButtons()
...
...
elseif ( C_StorePublic.IsDisabledByParentalControls() ) then
StoreMicroButton.disabledTooltip = BLIZZARD_STORE_ERROR_PARENTAL_CONTROLS;
StoreMicroButton:Disable();
else
StoreMicroButton.disabledTooltip = nil;
StoreMicroButton:Enable();
end
end
Reply Quote
100 Pandaren Warrior
5430
I really have no idea what the above is about, but this bug is annoying as hell.
Reply Quote
100 Draenei Shaman
20715
10/30/2013 05:58 AMPosted by Omegal
TLDR: there is no working solution on the addon side for many frames suffering from this new problem.

Far as I've seen, this shouldn't be affecting raid frames.


That's only because you're not testing with addons that modify the RaidFrame. This problem only arises in the first place if you're using an addon (ie insecure code) which taints the code path leading up to problematic call to UpdateMicroButtons(). RoleIcons is my addon that modifies the RaidFrame and worked perfectly until this change, and now generates the IsDisabledByParentalControls() error, with apparently no error-free solution.

There is a way to globally fix it with side effect, you can't ever change talents or glyphs. Just taint the blizz store function (and of course, COMPLETELY avoid the blizz store after that or it'll definitely explode).
/script C_StorePublic.IsDisabledByParentalControls = function() end


This is NOT a good solution to the problem, and should not be recommended to anyone or used by addons. It does silence the error, but it ALSO taints the TalentFrame so you can no longer change talents. It also taints many other frames in your UI (any code path that calls UpdateMicroButtons()), breaking them in subtle ways.

Blizzard needs to fix this on their side. This "global fix" just replaces an annoying but harmless error message with a broken UI.
Reply Quote
90 Undead Hunter
12975
this bug is annoying as hell.
Reply Quote
90 Night Elf Rogue
5785
The solution is obvious to me, like op said, blizz could fix this in about 2 minutes worth of time. They could even leave the function protected. just don't call it in updatemicrobuttons. Call it on load/login and save the answer, and then just check THAT in UMB

Well said Omegal, your solution was exactly what I envisioned.

On a side note, I understand that Blizzard doesn't support Addons. However because the mere act of opening the InterfaceOptionsPanel, a section of the UI they gave us to use for addon settings, triggers this problem, I feel they should address this sooner rather than later. I hope we don't have to wait for the next patch for a fix.
Edited by Rotule on 10/30/2013 8:09 AM PDT
Reply Quote
90 Goblin Priest
6610
10/30/2013 08:05 AMPosted by Rotule
The solution is obvious to me, like op said, blizz could fix this in about 2 minutes worth of time. They could even leave the function protected. just don't call it in updatemicrobuttons. Call it on load/login and save the answer, and then just check THAT in UMB

Well said Omegal, your solution was exactly what I envisioned.

On a side note, I understand that Blizzard doesn't support Addons. However because the mere act of opening the InterfaceOptionsPanel, a section of the UI they gave us to use for addon settings, triggers this problem, I feel they should address this sooner rather than later. I hope we don't have to wait for the next patch for a fix.


Honestly I think the Blizzard will probably never fix it unless it seriously breaks something. With the older scripting language WoW uses I wouldn't be suprised if they would just rather make a new game before they fix that bug.
Reply Quote
MVP - Technical Support
100 Human Warrior
19545
This is NOT a good solution to the problem, and should not be recommended to anyone or used by addons. It does silence the error, but it ALSO taints the TalentFrame so you can no longer change talents. It also taints many other frames in your UI (any code path that calls UpdateMicroButtons()), breaking them in subtle ways.

Blizzard needs to fix this on their side. This "global fix" just replaces an annoying but harmless error message with a broken UI.

You did read all of my post right? I said it's not good for addons to do it. I said that's the best work around for a USER who understands that it'll break talents frame. That it does come with it's own problems. Blizzard should answer for this major screw up and fix it themselves.

However, I have been using this "fix" or "tradeoff" of sorts and I've yet to see it affect anything else but talents frame (and i can always reloadui to change a talent before rerunning script). Even when using several mods that all use different and various frames microbutton affects. You're recommending not using something that breaks stuff, but compare it to what's already broken. Depending on the user as well as their mods, they may find that one breakage is better than other. It's a tipping scale. I'm merely providing alternate solutions to the users who at least want to try/use SOMETHING until (and if) blizzard fixes this problem.
Reply Quote
90 Gnome Warlock
13855
This doesn't fix the problem (there's no really good way to fix it addon side), but you can at least prevent the popup from showing with this:


hooksecurefunc("StaticPopup_Show", function(which)
if(which == "ADDON_ACTION_FORBIDDEN") then
StaticPopup_Hide(which);
end
end)
Reply Quote
This doesn't fix the problem (there's no really good way to fix it addon side), but you can at least prevent the popup from showing with this:


hooksecurefunc("StaticPopup_Show", function(which)
if(which == "ADDON_ACTION_FORBIDDEN") then
StaticPopup_Hide(which);
end
end)


That was actually what I was thinking about doing when I get home :P
Reply Quote
90 Undead Hunter
12975
This doesn't fix the problem (there's no really good way to fix it addon side), but you can at least prevent the popup from showing with this:


hooksecurefunc("StaticPopup_Show", function(which)
if(which == "ADDON_ACTION_FORBIDDEN") then
StaticPopup_Hide(which);
end
end)


Was wondering if there was a way to just do this, thank you!
Reply Quote
10/30/2013 07:23 AMPosted by Sphyx
this bug is annoying as hell.
Reply Quote
100 Draenei Shaman
20715
However, I have been using this "fix" or "tradeoff" of sorts and I've yet to see it affect anything else but talents frame (and i can always reloadui to change a talent before rerunning script). Even when using several mods that all use different and various frames microbutton affects. You're recommending not using something that breaks stuff, but compare it to what's already broken. Depending on the user as well as their mods, they may find that one breakage is better than other. It's a tipping scale. I'm merely providing alternate solutions to the users who at least want to try/use SOMETHING until (and if) blizzard fixes this problem.


There are many addons for safely controlling/silencing the output of lua errors, without breaking other parts of the UI (eg Swatter, BugGrabber, BugSack, ImprovedErrorFrame, etc). The five-liner posted by Kitale gets the same silencing effect without addons, without massively tainting the UI.
Edited by Ashel on 10/30/2013 4:29 PM PDT
Reply Quote
MVP - Technical Support
100 Human Warrior
19545
Silencing errors is crap though. You won't know when stuff is actually broken, it's just as bad honestly. Heck, I despise at all blizz lets you even turn off lua errors. You know how much time tech support mvps and blizz wastes on users who have busted mods because they don't KNOW it? :\

In other words, EVERY solution to this problem sucks, because there is no valid solution. You simply have to choose your flavor of suck you like the most. I'm against addons doing it really because you have 10 different addons doing 10 different ways to fix it and probably have a bigger mess than before. Give a user a simple script like above for store, or that 5 liner, or maybe even this
/script UiParent:UnregisterEvent("ADDON_ACTION_FORBIDDEN")

And let them do it the way they like. While we keep nagging blizz for a proper fix.
Edited by Omegal on 10/30/2013 5:07 PM PDT
Reply Quote
So far, Atlasloot_Loader and PetTracker have set this off. Every time I close my map I get the "blocked by BlizzardUI. Disable/Ignore" pop-up.

Thought it was a mod error so I re-downloaded a bunch of mods(most hadn't been updated since the last time I downloaded them). Nope. The error is on Blizzard's end.
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)
Submit Cancel

Reported!

[Close]