NTFS Execution Settings

Martin Pitt martin.pitt at ubuntu.com
Sat Jun 18 03:27:57 PDT 2011


Hello Chris,

Chris Jaquet [2011-06-13 16:54 +0200]:
> Recently in fedora 14 (and by default in fedora 15) the udisks package
> version 1.0.2-4 has been used, and having perused the web for a while, I see
> that this version is the one that by default disables execution of files on
> NTFS partitions and removable devices.

This was done to be consistent with VFAT handling, as they mark all
files as executable. This is overzealous, and causes quite a lot of
confusion as file managers like nautilus will then ask the user
whether they want to open or run that .txt or .jpg file you want to
look at. Now VFAT and NTFS use the showexec mount option, which causes
only .exe, .com, and .bat files to be executable (which makes them
work nicely with Wine or Mono), but not all files.

The case where this breaks is having Linux-ish executables on VFAT and
NTFS devices, but the fraction of people who need that is so small
(and also presumably knowledgeable enough to know how to work around
it) to sacrifice this against more sensible behavior of data files.

> How do I go about allowing files to be executed on NTFS systems?

For a particular device/partition you can create an entry in fstab
(with LABEL= or UUID=) and set the "exec" option there.

> Setting up all possible media in fstab is not an option as I also
> work with various removable drives which need to be readable by
> windows machines.

That's currently not possible, I'm afraid. One workaround would be to
name the executables ".exe" (if you need to run them on Windows as
well, they need to have this anyway), or write some small shell script
wrappers with a ".bat" name perhaps. Out of interest, is that for
cross-platform development with C# or similar? Mono programs are
usually named .exe anyway, to be executable under Windows.

Thanks,

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


More information about the devkit-devel mailing list