Skip to content

Commit

Permalink
fix variable mix up
Browse files Browse the repository at this point in the history
  • Loading branch information
mubix authored Oct 9, 2023
1 parent 1e8eff9 commit 12cf964
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions SolarFlare/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ static void Main(string[] args)
Console.WriteLine("============================================");
if(args.Length > 0)
{
path = args[0];
string path = args[0];
if(File.Exists(path))
{
using (StreamReader streamReader = File.OpenText(perfmondb))
using (StreamReader streamReader = File.OpenText(path))
{
string text;
while (!streamReader.EndOfStream && (text = streamReader.ReadLine()) != null)
Expand Down Expand Up @@ -196,6 +196,18 @@ static FlareData.DatHex GetDat()

static void ParseConnectionString(string text)
{
// SolarWinds Orion uses a default entropy for it's CryptUnprotectData
// This is currently being removed from the code base as far as I can tell
// so this may break in the future.

byte[] additionalEntropy = new byte[] { 2, 0, 1, 2, 0, 3, 0, 9 };


// SolarWindsDatabaseAccessCredential.json has been found to be used for external database connections
// I don't know why this is used and why it isn't in other cases..
string jsonpath = Environment.GetEnvironmentVariable("programdata");
jsonpath += "\\SolarWinds\\CredentialStorage\\SolarWindsDatabaseAccessCredential.json";

Dictionary<string, string> dictionary = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);
FlareData.FlareDB.DbCredential cred = new FlareData.FlareDB.DbCredential();
Dictionary<string, string> connString = text.Split(';')
Expand Down Expand Up @@ -318,13 +330,6 @@ static void ParseConnectionString(string text)

static void GetDatabaseConnection()
{
// SolarWinds Orion uses a default entropy for it's CryptUnprotectData
// This is currently being removed from the code base as far as I can tell
// so this may break in the future.

byte[] additionalEntropy = new byte[] { 2, 0, 1, 2, 0, 3, 0, 9 };


// SWNetPerfMon is where the database configuration is, it's a simple text file
string perfmondb = "";
try
Expand Down Expand Up @@ -353,11 +358,6 @@ static void GetDatabaseConnection()
}
Console.WriteLine($"| \tPath to SWNetPerfMon.DB is: {perfmondb}");

// SolarWindsDatabaseAccessCredential.json has been found to be used for external database connections
// I don't know why this is used and why it isn't in other cases..
string jsonpath = Environment.GetEnvironmentVariable("programdata");
jsonpath += "\\SolarWinds\\CredentialStorage\\SolarWindsDatabaseAccessCredential.json";

if (File.Exists(perfmondb))
{

Expand Down

0 comments on commit 12cf964

Please sign in to comment.