mirror of
https://github.com/wismna/ModernKeePassLib.git
synced 2025-10-03 15:40:20 -04:00
OpenWriteLocal now creates a memory stream from bytes
This commit is contained in:
@@ -225,9 +225,7 @@ namespace ModernKeePassLib.Serialization
|
|||||||
try { if(bEfsEncrypted) File.Decrypt(m_iocBase.Path); } // For TxF
|
try { if(bEfsEncrypted) File.Decrypt(m_iocBase.Path); } // For TxF
|
||||||
catch(Exception) { Debug.Assert(false); }
|
catch(Exception) { Debug.Assert(false); }
|
||||||
#endif
|
#endif
|
||||||
#if !ModernKeePassLib
|
|
||||||
otCreation = File.GetCreationTimeUtc(m_iocBase.Path);
|
otCreation = File.GetCreationTimeUtc(m_iocBase.Path);
|
||||||
#endif
|
|
||||||
#if !ModernKeePassLib
|
#if !ModernKeePassLib
|
||||||
// May throw with Mono
|
// May throw with Mono
|
||||||
FileSecurity sec = File.GetAccessControl(m_iocBase.Path, acs);
|
FileSecurity sec = File.GetAccessControl(m_iocBase.Path, acs);
|
||||||
@@ -256,9 +254,7 @@ namespace ModernKeePassLib.Serialization
|
|||||||
#if !ModernKeePassLib
|
#if !ModernKeePassLib
|
||||||
if(otCreation.HasValue && (otCreation.Value.Year >= 1971))
|
if(otCreation.HasValue && (otCreation.Value.Year >= 1971))
|
||||||
File.SetCreationTimeUtc(m_iocBase.Path, otCreation.Value);
|
File.SetCreationTimeUtc(m_iocBase.Path, otCreation.Value);
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !ModernKeePassLib
|
|
||||||
if(bEfsEncrypted)
|
if(bEfsEncrypted)
|
||||||
{
|
{
|
||||||
try { File.Encrypt(m_iocBase.Path); }
|
try { File.Encrypt(m_iocBase.Path); }
|
||||||
|
@@ -635,7 +635,7 @@ namespace ModernKeePassLib.Serialization
|
|||||||
private static Stream OpenWriteLocal(IOConnectionInfo ioc)
|
private static Stream OpenWriteLocal(IOConnectionInfo ioc)
|
||||||
{
|
{
|
||||||
#if ModernKeePassLib
|
#if ModernKeePassLib
|
||||||
return new MemoryStream();
|
return new MemoryStream(ioc.Bytes);
|
||||||
#else
|
#else
|
||||||
return new FileStream(ioc.Path, FileMode.Create, FileAccess.Write,
|
return new FileStream(ioc.Path, FileMode.Create, FileAccess.Write,
|
||||||
FileShare.None);
|
FileShare.None);
|
||||||
|
Reference in New Issue
Block a user