[Bug 509180] Re: ecryptfs sometimes seems to add trailing garbage to encrypted files

Erik Carstensen mandolaerik at gmail.com
Wed Jul 14 15:26:16 UTC 2010


One painful workaround is to not touch the file and remount the ecryptfs
partition (which usually means that you have to log out and re-login).

Another workaround is to use a script that I just wrote, which
automatically tries to drop the trailing garbage (kind of like the link
you posted, but automated)

The link you posted didn't observe these things:
- In some cases the trailing garbage can contain non-zeros; if the original object size was s this is typically seen in the intervals [4096, 4096 + s) and [8192, 8192+s).
- For non-blobs, there is a small probability (1/256) that the original object ends with a 0 byte.

My script will therefore try all 12288 possibile lengths, but in a smart
order so the above cases are tried early.

To use it, go to the working tree's root directory and run the script,
with the sha1 sum as only argument.


** Attachment added: "Script to automatically repair the damage caused by this bug"
   http://launchpadlibrarian.net/51930814/git-remove-trailing-garbage.py

-- 
ecryptfs sometimes seems to add trailing garbage to encrypted files
https://bugs.launchpad.net/bugs/509180
You received this bug notification because you are a member of Kernel
Bugs, which is subscribed to linux in ubuntu.




More information about the kernel-bugs mailing list