Trolled by the NSA

Posted on 7 August 2013 by Paolo Bernardi

Since I helped to troll the NSA by sharing a nifty auto-trolling script, they got back to me.

Hard.

It all started with the Fedora 19 that I’ve installed on my laptop. I’m slowly building an automatic configuration script with Ansible that includes the installation of Mirall, the ownCloud client file synchronization tool for Linux; I use it to synchronize small files to my home’s ownCloud, hosted by my Raspberry Pi.

Mirall can ignore some files in the synchronization process. It is a badly documented feature, inaccessible via the GUI, but it’s there: you just have to write the list of the file patterns that you want to ignore into one of these two files:

  • /etc/ownCloud/sync-exclude.lst
  • ~/.local/share/data/ownCloud/sync-exclude.lst

For example, my list is:

*.filepart
*~
*.bak
*.part
*.unison*
*csync_timedif.ctmp*
.*.sw?
.*.*sw?
.DS_Store
.ds_store
desktop.ini
Thumbs.db
*.lock

Anyway, even with this file in place, my KeePassX lock file (matched by the *.lock pattern) was still being synchronized!

After a few tries I decided to debug what Mirall was doing with strace.

$ grep exclude ~/owncloud.strace

Thanks to strace and grep I was able to pinpoint the open syscall that was trying to read /etc/ownCloud/sync-exclude.lst. Here’s the relevant row of the strace output:

open("/etc/ownCloud/sync-exclude.lst", O_RDONLY|O_CLOEXEC) = 15

15? As far as I know, the syscalls usually return 0 when they’re successful: 15 means that something’s wrong. Let’s see, if I recall correctly, that should be an error constant that’s in /usr/include/errno.h. Wait, this is kernel’s stuff, so it’s /usr/include/asm/errno.h. Umh no, this points to /usr/include/asm-generic/errno.h. And this one contains the error codes starting from 35 upwards, I must look at /usr/include/asm-generic/errno-base.h. PHEW, here it is!

#define    ENOTBLK        15    /* Block device required */</pre>

Block device required..?

ARGHHHHHHHHHHHH!

I just got trolled by SELinux, and, ultimately, by the NSA itself. -.-

Epilogue

https://bugzilla.redhat.com/show_bug.cgi?id=994671

Get in touch

Thank you for contacting me, I will be in touch with you as soon as possible.
There was an error while trying to send the comment, please try again later.