mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-01 07:51:54 +01:00
update environment detection
This commit is contained in:
@@ -114,6 +114,10 @@
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
|
||||
@@ -145,16 +145,6 @@ namespace MediaBrowser.ServerApplication.Native
|
||||
{
|
||||
AppContainer app = new AppContainer(PI_app.appContainerName, PI_app.displayName, PI_app.workingDirectory, PI_app.appContainerSid);
|
||||
|
||||
var app_capabilities = LoopUtil.getCapabilites(PI_app.capabilities);
|
||||
if (app_capabilities.Count > 0)
|
||||
{
|
||||
//var sid = new SecurityIdentifier(app_capabilities[0], 0);
|
||||
|
||||
IntPtr arrayValue = IntPtr.Zero;
|
||||
//var b = LoopUtil.ConvertStringSidToSid(app_capabilities[0].Sid, out arrayValue);
|
||||
//string mysid;
|
||||
//var b = LoopUtil.ConvertSidToStringSid(app_capabilities[0].Sid, out mysid);
|
||||
}
|
||||
app.LoopUtil = CheckLoopback(PI_app.appContainerSid);
|
||||
Apps.Add(app);
|
||||
}
|
||||
@@ -209,42 +199,6 @@ namespace MediaBrowser.ServerApplication.Native
|
||||
util.SaveLoopbackState();
|
||||
}
|
||||
|
||||
private static List<SID_AND_ATTRIBUTES> getCapabilites(INET_FIREWALL_AC_CAPABILITIES cap)
|
||||
{
|
||||
List<SID_AND_ATTRIBUTES> mycap = new List<SID_AND_ATTRIBUTES>();
|
||||
|
||||
IntPtr arrayValue = cap.capabilities;
|
||||
|
||||
var structSize = Marshal.SizeOf(typeof(SID_AND_ATTRIBUTES));
|
||||
for (var i = 0; i < cap.count; i++)
|
||||
{
|
||||
var cur = (SID_AND_ATTRIBUTES)Marshal.PtrToStructure(arrayValue, typeof(SID_AND_ATTRIBUTES));
|
||||
mycap.Add(cur);
|
||||
arrayValue = new IntPtr((long)(arrayValue) + (long)(structSize));
|
||||
}
|
||||
|
||||
return mycap;
|
||||
|
||||
}
|
||||
|
||||
private static List<SID_AND_ATTRIBUTES> getContainerSID(INET_FIREWALL_AC_CAPABILITIES cap)
|
||||
{
|
||||
List<SID_AND_ATTRIBUTES> mycap = new List<SID_AND_ATTRIBUTES>();
|
||||
|
||||
IntPtr arrayValue = cap.capabilities;
|
||||
|
||||
var structSize = Marshal.SizeOf(typeof(SID_AND_ATTRIBUTES));
|
||||
for (var i = 0; i < cap.count; i++)
|
||||
{
|
||||
var cur = (SID_AND_ATTRIBUTES)Marshal.PtrToStructure(arrayValue, typeof(SID_AND_ATTRIBUTES));
|
||||
mycap.Add(cur);
|
||||
arrayValue = new IntPtr((long)(arrayValue) + (long)(structSize));
|
||||
}
|
||||
|
||||
return mycap;
|
||||
|
||||
}
|
||||
|
||||
private static List<SID_AND_ATTRIBUTES> PI_NetworkIsolationGetAppContainerConfig()
|
||||
{
|
||||
|
||||
|
||||
@@ -7,4 +7,5 @@
|
||||
<package id="SimpleInjector" version="3.3.2" targetFramework="net462" />
|
||||
<package id="SQLitePCLRaw.core" version="1.1.2" targetFramework="net462" />
|
||||
<package id="SQLitePCLRaw.provider.sqlite3.net45" version="1.1.2" targetFramework="net462" />
|
||||
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net462" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user