There are multiple contexts for how a file might be "run."
The first is if you ask the kernel to run a program using the execve()
system call. This is where the file's execute permission comes into play; if the execute permission bit is not set, the file cannot be run as a program in this way.
The second is using some other special shell, such as Unity, Plasma or Nautilus. These shells will usually run the file
program to examine the file and retrieve a MIME type--a statement of what type of file it is and provide a visual indicator. If asked to open the file, they'll usually call xdg-open
, which will--again--run file
on the file, and then look up what the system is configured to do with that type of file, what programs are available to open it, etc.
There is one special, interesting case. Much like Windows' ".lnk" shortcut files, Linux has ".desktop" files. These files contain instructions on what the file's icon should look like, what should be done when the file is run, etc.
B.txt
file that actually is aB.txt.exe
and is far easier tricked into executing it. Apart from that the standard files, that are used for transferring information (i.e. text or pictures) are not executed on their own but rather interpreted by a program (reader, etc.). So I'd assume that in contrast to your thesis ignoring the extension is actually more secure as it raises the user's awareness, which is the most fundamental security issue. – FelixJN Mar 01 '17 at 20:44