1
Vote

Leftover bugbug - additional exceptions in "if (_subStatus == EncryptionSubStatus.None)"

description

From Encryption.cs > EncryptFile()
 
           if (_subStatus == EncryptionSubStatus.None)
           {
               try
               {
                   //
                   // Preserve the original time stamp on the file
                   //
                   DateTime _lastWriteTimeUtc = File.GetLastWriteTimeUtc(fileName);
                   File.Encrypt(fileName);
                   File.SetLastWriteTimeUtc(fileName, _lastWriteTimeUtc);
                   _status = EncryptionStatus.Encrypted;
                   _subStatus = EncryptionSubStatus.NewlyEncrypted;
 
               }
               catch (Exception e)
               {
                   Log.EFSAsstTrace("FailedToEncryptFile", fileName, e.Message);
                   // bugbug - there may be other reasons for a failure...
                   _subStatus = EncryptionSubStatus.AccessDenied;

comments