After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769181 - Text files sometimes treated as executable whereas they are not
Text files sometimes treated as executable whereas they are not
Status: RESOLVED NOTGNOME
Product: nautilus
Classification: Core
Component: general
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-07-26 10:01 UTC by jeremy9856
Modified: 2016-08-03 16:08 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description jeremy9856 2016-07-26 10:01:48 UTC
Hello,

I noticed that Text files are sometimes treated as executable whereas they are not.

Here are the use cases where it happen :

- .txt created or copied in encfs folder are treated as executable whereas there are not (permissions => not executable)
- .txt copied to NTFS partition are treated as executable

Thanks !
Comment 1 jeremy9856 2016-08-03 10:28:46 UTC
Here is some more infos from gvfs-info:

encfs folder
=====================
nom affiché : Decrypted
nom d'édition : Decrypted
nom : Decrypted
type : répertoire
taille :  4096
uri : file:///media/Data/Decrypted
attributs :
  standard::type: 2
  standard::name: Decrypted
  standard::display-name: Decrypted
  standard::edit-name: Decrypted
  standard::copy-name: Decrypted
  standard::icon: folder
  standard::content-type: inode/directory
  standard::fast-content-type: inode/directory
  standard::size: 4096
  standard::allocated-size: 4096
  standard::symbolic-icon: folder-symbolic, folder
  etag::value: 1469526889:807874
  id::file: l44:7602177
  id::filesystem: l44
  access::can-read: TRUE
  access::can-write: TRUE
  access::can-execute: TRUE
  access::can-delete: TRUE
  access::can-trash: TRUE
  access::can-rename: TRUE
  time::modified: 1469526889
  time::modified-usec: 807874
  time::access: 1467976390
  time::access-usec: 69490
  time::changed: 1469526889
  time::changed-usec: 807874
  unix::device: 44
  unix::inode: 7602177
  unix::mode: 16832
  unix::nlink: 5
  unix::uid: 1000
  unix::gid: 1000
  unix::rdev: 0
  unix::block-size: 4096
  unix::blocks: 8
  unix::is-mountpoint: TRUE
  owner::user: jeremy
  owner::user-real: Jeremy
  owner::group: jeremy
  metadata::nautilus-list-view-sort-column: name
  metadata::nautilus-list-view-sort-reversed: false


NTFS volume
=====================
nom affiché : HDD_500Go
nom d'édition : HDD_500Go
nom : HDD_500Go
type : répertoire
taille :  4096
uri : file:///run/media/jeremy/HDD_500Go
attributs :
  standard::type: 2
  standard::name: HDD_500Go
  standard::display-name: HDD_500Go
  standard::edit-name: HDD_500Go
  standard::copy-name: HDD_500Go
  standard::icon: folder
  standard::content-type: inode/directory
  standard::fast-content-type: inode/directory
  standard::size: 4096
  standard::allocated-size: 4096
  standard::symbolic-icon: folder-symbolic, folder
  etag::value: 1469526993:323588
  id::file: l2113:5
  id::filesystem: l2113
  access::can-read: TRUE
  access::can-write: TRUE
  access::can-execute: TRUE
  access::can-delete: FALSE
  access::can-trash: FALSE
  access::can-rename: FALSE
  time::modified: 1469526993
  time::modified-usec: 323588
  time::access: 1469527073
  time::access-usec: 760346
  time::changed: 1469526993
  time::changed-usec: 323588
  unix::device: 2113
  unix::inode: 5
  unix::mode: 16895
  unix::nlink: 1
  unix::uid: 1000
  unix::gid: 1000
  unix::rdev: 0
  unix::block-size: 4096
  unix::blocks: 8
  unix::is-mountpoint: TRUE
  owner::user: jeremy
  owner::user-real: Jeremy
  owner::group: jeremy
  metadata::nautilus-list-view-sort-column: name
  metadata::nautilus-list-view-sort-reversed: false
Comment 2 jeremy9856 2016-08-03 10:34:25 UTC
Here is some more infos from stat:

encfs folder
=====================
  Fichier : '/media/Data/Decrypted/'
   Taille : 4096      	Blocs : 8          Blocs d'E/S : 4096   répertoire
Périphérique : 2ch/44d	Inœud : 7602177     Liens : 5
Accès : (0700/drwx------)  UID : ( 1000/  jeremy)   GID : ( 1000/  jeremy)
 Accès : 2016-07-08 13:13:10.069490085 +0200
Modif. : 2016-07-26 11:54:49.807874140 +0200
Changt : 2016-07-26 11:54:49.807874140 +0200
  Créé : -

NTFS volume
=====================
  Fichier : '/run/media/jeremy/HDD_500Go'
   Taille : 4096      	Blocs : 8          Blocs d'E/S : 4096   répertoire
Périphérique : 841h/2113d	Inœud : 5           Liens : 1
Accès : (0777/drwxrwxrwx)  UID : ( 1000/  jeremy)   GID : ( 1000/  jeremy)
 Accès : 2016-07-26 11:57:53.760346700 +0200
Modif. : 2016-07-26 11:56:33.323588100 +0200
Changt : 2016-07-26 11:56:33.323588100 +0200
  Créé : -
Comment 3 Ondrej Holy 2016-08-03 11:44:21 UTC
#nautilus:
gicmo	seems like they all have their +x bit set
...
paviluf	encfs folder is not on ntfs
Nautilus show that +x is disabled for encfs folder
But Nautilus show that +x is enabled for NTFS. It should not since NTFS doesn't know permissions
gicmo	I would guess Nauti is just relaying the gvfs information and IIRC (is a while ago) we use the access() syscall for can-write, can-write for locally mounted fs
...
oholy_	Yes, I am conviced that there isn't any problem with the files on NTFS, stat shows executable bit, gvfs-info shows can-execute. You can modify umask/fmask/dmask to not mark them as executable, see man ntfs-3g...
Similar with encfs, stat shows executable bit, gvfs-info shows can-execute. Google shows lot of result for "encfs permissions". Only weird thing is why Nautilus shows, that the file on encfs is not executable...
Is "Allow executing file as program" really unchecked for those files?
paviluf	yes
oholy_	so this might be a bug in nautilus, rest of issues depends on configuration of ntfs/encfs...
Comment 4 jeremy9856 2016-08-03 13:21:55 UTC
It seem that is a Nautilus problem

https://bugzilla.redhat.com/show_bug.cgi?id=1363723
Comment 5 jeremy9856 2016-08-03 13:27:35 UTC
At least for the encfs folder:

(In reply to jeremy9856 from comment #3)
> (In reply to Vasiliy Glazov from comment #2)
> > Can you give simple steps to reproduce this problem?
> 
> Of course everything you need.
> 
> > If you just run
> > touch file.txt
> > in encfs directory then file.txt has exec bit?
> 
> It don't seem so :
> 
>   Fichier : 'test.txt'
>    Taille : 0         	Blocs : 0          Blocs d'E/S : 4096   fichier vide
> Périphérique : 2ch/44d	Inœud : 7604645     Liens : 1
> Accès : (0664/-rw-rw-r--)  UID : ( 1000/  jeremy)   GID : ( 1000/  jeremy)
>  Accès : 2016-08-03 14:57:43.433772000 +0200
> Modif. : 2016-08-03 14:57:43.433772000 +0200
> Changt : 2016-08-03 14:57:43.433772956 +0200
>   Créé : -
> 
> Here is the stat of a file already in encfs folder:
> 
> stat notes.txt 
>   Fichier : 'notes.txt'
>    Taille : 116       	Blocs : 8          Blocs d'E/S : 4096   fichier
> Périphérique : 2ch/44d	Inœud : 7733358     Liens : 1
> Accès : (0644/-rw-r--r--)  UID : ( 1000/  jeremy)   GID : ( 1000/  jeremy)
>  Accès : 2016-07-08 10:13:57.134234000 +0200
> Modif. : 2015-01-19 04:34:46.000000000 +0100
> Changt : 2016-07-25 15:39:33.944590126 +0200
>   Créé : -
> 
> Nautilus treat both files as executable. To remember here is the stat of the
> encfs folder:
> 
>   Fichier : '/media/Data/Decrypted/'
>    Taille : 4096      	Blocs : 8          Blocs d'E/S : 4096   répertoire
> Périphérique : 2ch/44d	Inœud : 7602177     Liens : 5
> Accès : (0700/drwx------)  UID : ( 1000/  jeremy)   GID : ( 1000/  jeremy)
>  Accès : 2016-07-08 13:13:10.069490085 +0200
> Modif. : 2016-08-03 14:59:09.161554253 +0200
> Changt : 2016-08-03 14:59:09.161554253 +0200
>   Créé : -
> 
> 
> > Show output of command: 
> > mount | grep encfs
> 
> encfs on /media/Data/Decrypted type fuse.encfs
> (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
> 
> 
> > ls -la <encfs_directory>
> 
> total 20
> drwx------   5 jeremy jeremy 4096  3 août  14:59 .
> drwxr-xr-x. 17 jeremy jeremy 4096 25 juil. 16:11 ..
> drwxrwxr-x   4 jeremy jeremy 4096 18 juil. 13:47 Browsers
> drwxr-xr-x   4 jeremy jeremy 4096 26 juil. 17:07 Documents
> drwx------   5 jeremy jeremy 4096  9 juil. 11:10 .Trash-1000

(In reply to Vasiliy Glazov from comment #4)
> If in console files are not executable then it is Nautilus problem.
Comment 6 Christian Kellner 2016-08-03 15:18:01 UTC
I had a brief look at this. Seems access(2) is returning 0 (success) for the text file on encfs:

Looking at "strace gvfs-info":
access("/home/gicmo/test/dec/test.txt", R_OK) = 0
access("/home/gicmo/test/dec/test.txt", W_OK) = 0
access("/home/gicmo/test/dec/test.txt", X_OK) = 0

If I am not mistaken we use that info for "access::can-execute".
Comment 7 Christian Kellner 2016-08-03 16:01:59 UTC
Doesn't happen with encfs master (what will be 1.9): "access::can-execute: FALSE" Probably related to changes in encfs and the passing of "-o default_permission" to FUSE. I guess not our bug.