diff --git a/Lib/Collectors/OpenPortCollector.cs b/Lib/Collectors/OpenPortCollector.cs index c1da59a2e..1fdfafd2b 100644 --- a/Lib/Collectors/OpenPortCollector.cs +++ b/Lib/Collectors/OpenPortCollector.cs @@ -167,7 +167,7 @@ private void ExecuteOsX() { try { - var result = ExternalCommandRunner.RunExternalCommand("sudo", "lsof -Pn -i4 -i6"); + string result = ExternalCommandRunner.RunExternalCommand("lsof -Pn -i4 -i6"); foreach (var _line in result.Split('\n')) { diff --git a/Lib/Collectors/ServiceCollector.cs b/Lib/Collectors/ServiceCollector.cs index 5b2918758..1a987d345 100644 --- a/Lib/Collectors/ServiceCollector.cs +++ b/Lib/Collectors/ServiceCollector.cs @@ -221,41 +221,6 @@ public void ExecuteMacOs() { Log.Error("Error executing {0}", "launchctl list"); } - try - { - // Then get the system processes - var result = ExternalCommandRunner.RunExternalCommand("sudo", "launchctl list"); - - foreach (var _line in result.Split('\n')) - { - // Lines are formatted like this, with single tab separation: - // PID Exit Name - // 1015 0 com.apple.appstoreagent - var _fields = _line.Split('\t'); - if (_fields.Length < 3 || _fields[0].Contains("PID")) - { - continue; - - } - var obj = new ServiceObject() - { - DisplayName = _fields[2], - Name = _fields[2], - // If we have a current PID then it is running. - State = (_fields[0].Equals("-")) ? "Stopped" : "Running" - }; - - if (!outDict.ContainsKey(obj.Identity)) - { - DatabaseManager.Write(obj, this.RunId); - outDict.Add(obj.Identity, obj); - } - } - } - catch (ExternalException) - { - Log.Error("Error executing {0}", "sudo launchctl list"); - } } ///