Skip to content

Commit

Permalink
skip mac os tests
Browse files Browse the repository at this point in the history
  • Loading branch information
checkymander committed Feb 29, 2024
1 parent 5602d1f commit 7a8d552
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ public LsTests()
[TestMethod]
public void TestValidParentPath()
{
//if (OperatingSystem.IsMacOS() || OperatingSystem.IsLinux())
//{
// //Temporary skip until I can fucking test on a mac and see what's going on
if (OperatingSystem.IsMacOS())
{
//Temporary skip until I can fucking test on a mac and see what's going on

// //For some reason /etc is returning /System/etc
//For some reason /etc is returning /System/etc

// Assert.IsTrue(true);
// return;
//}
Assert.IsTrue(true);
return;
}


string path;
Expand Down
26 changes: 20 additions & 6 deletions Payload_Type/athena/athena/agent_code/entitlements/entitlements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public async Task Execute(ServerJob job)
string GetProcessEntitlements(int pid)
{
// Get the process path
string processPath = GetProcessPath(pid);;
string processPath = GetProcessPath(pid); ;

return GetEntitlementsFromBundle(processPath);
}
Expand Down Expand Up @@ -55,12 +55,26 @@ string GetProcessPath(int pid)
}
string GetEntitlementsFromBundle(string bundlePath)
{
return bundlePath;
// You can implement your logic to extract entitlements from the bundle path here.
// This might involve reading the Info.plist file of the bundle and extracting the entitlements.
return ReadInfoPlist(bundlePath);
}
string ReadInfoPlist(string bundlePath)
{
Console.WriteLine(bundlePath);
string infoPlistPath = Path.Combine(bundlePath, "../", "../", "../", "Contents", "Info.plist");

if (!File.Exists(infoPlistPath))
{
return "Info.plist file does not exist.";
}

// For simplicity, let's assume a placeholder value for the entitlements.
//return "Placeholder Entitlements";
try
{
return File.ReadAllText(infoPlistPath);
}
catch (Exception ex)
{
return $"Error reading Info.plist: {ex.Message}";
}
}
}
}

0 comments on commit 7a8d552

Please sign in to comment.