The Free Software Media System - Server Backend & API
placeholder for plugin security fix
LukePulverenti6c86721f6de2
diff --git a/MediaBrowser.Common/Kernel/IKernel.cs b/MediaBrowser.Common/Kernel/IKernel.csindex 1685f1f648..253368f4ff 100644--- a/MediaBrowser.Common/Kernel/IKernel.cs+++ b/MediaBrowser.Common/Kernel/IKernel.cs@@ -151,5 +151,10 @@ namespace MediaBrowser.Common.Kernel/// </summary>/// <value>The rest services.</value>IEnumerable<IRestfulService> RestServices { get; }++ /// <summary>+ /// Notifies the pending restart.+ /// </summary>+ void NotifyPendingRestart();}}diff --git a/MediaBrowser.Controller/Plugins/PluginSecurityManager.cs b/MediaBrowser.Controller/Plugins/PluginSecurityManager.csindex f559d1fd04..bac7c61357 100644--- a/MediaBrowser.Controller/Plugins/PluginSecurityManager.cs+++ b/MediaBrowser.Controller/Plugins/PluginSecurityManager.cs@@ -1,5 +1,8 @@using Mediabrowser.Model.Entities;using Mediabrowser.PluginSecurity;+using MediaBrowser.Common.Kernel;+using MediaBrowser.Common.Net;+using System;using System.Threading;using System.Threading.Tasks;@@ -8,7 +11,7 @@ namespace MediaBrowser.Controller.Plugins/// <summary>/// Class PluginSecurityManager/// </summary>- public class PluginSecurityManager : BaseManager<Kernel>+ public class PluginSecurityManager{/// <summary>/// The _is MB supporter@@ -36,12 +39,32 @@ namespace MediaBrowser.Controller.Plugins}}+ /// <summary>+ /// The _network manager+ /// </summary>+ private INetworkManager _networkManager;++ private IKernel _kernel;+/// <summary>/// Initializes a new instance of the <see cref="PluginSecurityManager" /> class./// </summary>/// <param name="kernel">The kernel.</param>- public PluginSecurityManager(Kernel kernel) : base(kernel)+ /// <param name="networkManager">The network manager.</param>+ public PluginSecurityManager(IKernel kernel, INetworkManager networkManager){+ if (kernel == null)+ {+ throw new ArgumentNullException("kernel");+ }++ if (networkManager == null)+ {+ throw new ArgumentNullException("networkManager");+ }++ _kernel = kernel;+ _networkManager = networkManager;}/// <summary>@@ -52,6 +75,7 @@ namespace MediaBrowser.Controller.Plugins/// <returns>Task{MBRegistrationRecord}.</returns>public async Task<MBRegistrationRecord> GetRegistrationStatus(string feature, string mb2Equivalent = null){+ // Update this method to add _networkManager as a param.return await MBRegistration.GetRegistrationStatus(feature, mb2Equivalent).ConfigureAwait(false);}@@ -62,15 +86,16 @@ namespace MediaBrowser.Controller.Pluginspublic string SupporterKey{get { return MBRegistration.SupporterKey; }- set {+ set+ {if (value != MBRegistration.SupporterKey){MBRegistration.SupporterKey = value;// Clear this so it will re-evaluateResetSupporterInfo();// And we'll need to restart to re-evaluate the status of plug-ins- Kernel.NotifyPendingRestart();-+ _kernel.NotifyPendingRestart();+}}}@@ -82,10 +107,11 @@ namespace MediaBrowser.Controller.Pluginspublic string LegacyKey{get { return MBRegistration.LegacyKey; }- set {+ set+ {MBRegistration.LegacyKey = value;// And we'll need to restart to re-evaluate the status of plug-ins- Kernel.NotifyPendingRestart();+ _kernel.NotifyPendingRestart();}}