Skip to content

Commit

Permalink
Do not log Send/Receive passwords (#339)
Browse files Browse the repository at this point in the history
Most code paths replaced the user's Send/Receive password with a string
of asterisks, but there was one code path where this was missed.
  • Loading branch information
rmunn authored Apr 26, 2024
1 parent ccdf57d commit 38ecab3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/LibChorus/VcsDrivers/Mercurial/HgRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1071,13 +1071,18 @@ internal string RepositoryURIForLog(RepositoryAddress address)
// and it will appear later in the log.
if(address.URI.Contains(RepositoryAddress.ProjectNameVariable))
{
return address.GetPotentialRepoUri(Identifier,
return ServerSettingsModel.RemovePasswordForLog(address.GetPotentialRepoUri(Identifier,
Path.GetFileNameWithoutExtension(_pathToRepository) + Path.GetExtension(_pathToRepository),
_progress);
_progress));
}
}
catch { /* Don't throw trying to get extra information to log */ }
return address.URI;
try
{
return ServerSettingsModel.RemovePasswordForLog(address.URI);
}
catch { /* Really don't throw trying to get extra information to log */ }
return "(unknown error getting URI)";
}

/// <summary>
Expand Down

0 comments on commit 38ecab3

Please sign in to comment.