You are not logged in.

#1 2010-11-07 17:50:16

JPr
Member
From: Moon
Registered: 2010-11-06
Posts: 8
Website

Files from other drives/partitions always 'executable'

I'm having a strange issue where files that are copied off of a USB drive, or my Windows NTFS partition, always have the 'executable' flag set. CD/DVDs are unaffected. This even happens if I copy a file from Arch (a file which doesn't have the 'executable' box checked) to another drive and then copy it back.

It's my understanding that NTFS, FAT16/32 and some other file systems don't have this flag so naturally the lack of 'executable' permissions won't carry over, but I am pretty sure it shouldn't be automatically setting it when I copy it over to Arch.

It happens with both Nautilus and 'cp -p' command.

This isn't a huge deal but it does mess with opening transferred files a little, plus I'm a little worried about the security implications. Manually chmodding/unsetting the flag is a little annoying. I'm using Gnome, Arch is up to date. I'm sure I probably am just overlooking a setting but not really sure what.

Thanks!

Last edited by JPr (2010-11-07 17:53:41)


(  ' ')ノ ⌒●~*

Offline

#2 2010-11-07 18:10:40

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Files from other drives/partitions always 'executable'

NTFS and FAT have no concept of linux's permissions and ownership. They can only be set via mount options. When you copy a file to a partition, it assumes whatever the mount time setting is.

Look at the fmask, dmask, and mask options in mount(8).

Offline

#3 2010-11-07 18:35:27

JPr
Member
From: Moon
Registered: 2010-11-06
Posts: 8
Website

Re: Files from other drives/partitions always 'executable'

I'm using the default udisks to manage usb drive mounting, while FUSE seems to be what's managing the Windows partition. How would I adjust the mount time settings with it? Google has led me to nothing conclusive.

Sorry for the obtuse question, just not sure... and indepth configuration of both of them is something I'm not familiar with.

Last edited by JPr (2010-11-07 20:27:05)


(  ' ')ノ ⌒●~*

Offline

#4 2010-11-07 18:42:27

ozar
Member
From: USA
Registered: 2005-02-18
Posts: 1,686

Re: Files from other drives/partitions always 'executable'

This worked for me to prevent all files from being executable, but other issues arose with it:

https://wiki.archlinux.org/index.php/Wr … ormal_user

Hope it helps you.


oz

Offline

#5 2010-11-08 15:32:05

JPr
Member
From: Moon
Registered: 2010-11-06
Posts: 8
Website

Re: Files from other drives/partitions always 'executable'

Thanks for the reply, but that's not quite what I'm looking for. I don't want to have to fstab all my usb sticks and drives. big_smile

I attempted to modify the udev rules listed here: https://wiki.archlinux.org/index.php/Ud … SB_devices . I tested it using a FAT32 USB stick, but that just made it mount the device as root. After a bit more fruitless testing, I stupidly realized it's using mount/umount, instead of udisks which it uses when normally mounting USB sticks and the like (I checked with tail.) Not sure how to edit the rules in order to make a custom rules file use udisks

I still don't know if that would fix the mounting as root problem as it's probably interpreting rules as root to start with.

I'm a little annoyed that there isn't a udisks.conf somewhere. neutral

EDIT: Updated after messing with automount rules.

Last edited by JPr (2010-11-08 20:37:36)


(  ' ')ノ ⌒●~*

Offline

Board footer

Powered by FluxBB