replace usage of IoConnectionInfo::GetDisplayName() to avoid passwords (as part of the URL) appearing in logfiles

This commit is contained in:
Philipp Crocoll
2023-11-21 13:31:54 +01:00
parent 2e9400cf4d
commit 6ef8b8fc3b
4 changed files with 10 additions and 8 deletions

View File

@@ -185,7 +185,7 @@ namespace KeePassLib.Serialization
byte[] pbFile = StrUtil.Utf8.GetBytes(sb.ToString());
s = IOConnection.OpenWrite(iocLockFile);
if(s == null) throw new IOException(iocLockFile.GetDisplayName());
if(s == null) throw new IOException(UrlUtil.GetFileName(iocLockFile.Path));
s.Write(pbFile, 0, pbFile.Length);
}
finally { if(s != null) s.Close(); }
@@ -205,7 +205,7 @@ namespace KeePassLib.Serialization
if(lfiEx != null)
{
m_iocLockFile = null; // Otherwise Dispose deletes the existing one
throw new FileLockException(iocBaseFile.GetDisplayName(),
throw new FileLockException(UrlUtil.GetFileName(iocBaseFile.Path),
lfiEx.GetOwner());
}