Details
-
Technical task
-
Resolution: Unresolved
-
Medium
-
None
-
None
-
None
-
3
-
9223372036854775807
Description
When files encrypted with fscrypt are deleted, they may need special handling to ensure that the encryption context is properly saved, so that they can be accessed and decrypted again in the future.
Normally, the fscrypt files are stored in a directory that contains the encryption context for the files, and cannot be mixed with unencrypted files in the same directory. We need to ensure that this is still true while files are in the Trash Can, at a minimum to add test cases to confirm this is working and continues to work.
The TCU code is already copying all xattrs from the parent directory to the new stub directory, so this may be enough to maintain fscrypt functionality. Also, since deleted files from each parent are placed in their own stub directory, this should avoid mixing encrypted and unencrypted files.
When encrypted files are undeleted from Trash then it is necessary that they be restored into a directory that has the same encryption context as the stub directory, either by undeleting the whole directory, or restoring the file into another directory that is already encrypted.