[URGENT] How Do I Fix Thunderbird Email Client User Profile Corruption?

silver.bullet at zoho.com silver.bullet at zoho.com
Wed Oct 7 18:56:13 UTC 2015


On Thu, 8 Oct 2015 01:43:36 +0800, Teo En Ming wrote:
>Maybe Singapore Government hackers hacked into my Lubuntu 15.10 Linux
>virtual machine

Perhaps, but why should they hack this file? This makes no sense.

>How can I prevent the corruption of the file prefs.js in future?

One layer of protection could be to make the file write protect and
assumed Thunderbird won't work, if the file is write protected, then
write a wrapper that will restore the file from a write protected
backup. The .desktop file could launch the thunderbird wrapper instead
of thunderbird. It's not really secure against violation, it just
wouldn't allow to directly write to the file, even not with root
privileges.
I won't write a wrapper for you today, but here's an example how to
write protect and how to restore from a write protected backup, assumed
the original file is corrupted.

Generating a file as an example
$ echo "test" > test-file.txt

Making a backup
$ cp test-file.txt test-file.txt.secure

Write protect the backup
$ sudo chattr +i test-file.txt.secure

Showing the files contents 
$ cat test-file.txt
test
$ cat test-file.txt.secure 
test

Trying to corrupt the files
$ echo "corrupted" >> test-file.txt 
$ echo "corrupted" >> test-file.txt.secure 
bash: test-file.txt.secure: Permission denied

As you can see, the backup is protected

$ diff test-file.txt test-file.txt.secure 
2d1
< corrupted
$ cat test-file.txt
test
corrupted
$ cat test-file.txt.secure 
test

Now restore the file assumed it's different to the backup
$ diff test-file.txt test-file.txt.secure || cp -pf test-file.txt.secure test-file.txt
2d1
< corrupted

No difference anymore, the file is restored
$ diff test-file.txt test-file.txt.secure 
$ cat test-file.txt
test
$ cat test-file.txt.secure 
test

I suspect you made a mistake and it isn't worth the hassle to write a
wrapper. As already pointed out, even a write protection isn't secure
against violation by a hacker.

FWIW even root privileges don't allow to write to the file or delete the
file
$ rm test-file.txt*
rm: remove write-protected regular file ‘test-file.txt.secure’? y
rm: cannot remove ‘test-file.txt.secure’: Operation not permitted
$ sudo rm test-file.txt* 
rm: cannot remove ‘test-file.txt.secure’: Operation not permitted

After removing the immutable attribute writing and removing works
$ sudo chattr -i test-file.txt.secure 
$ rm test-file.txt*

Regards,
Ralf





More information about the ubuntu-users mailing list