Opened 9 years ago

Last modified 2 years ago

#5783 assigned bug

[Tracker] don't try to fix executable bit on read only file systems

Reported by: diver Owned by: nobody
Priority: normal Milestone: R1
Component: Applications/Tracker Version: R1/Development
Keywords: Cc: siarzhuk
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

Some files (e.g. images) from my ext3 have executable bit set. Trying to open such files results in a tracker message:


If I try to fix it tracker shows:


The only way I could open such files is to use Open with menu.
I think that offering to fix executable bit on read only partitions doesn't make any sense.

Attachments (2)

tracker_alert.png (6.7 KB) - added by diver 9 years ago.
tracker_alert_2.png (4.7 KB) - added by diver 9 years ago.

Download all attachments as: .zip

Change History (9)

Changed 9 years ago by diver

Attachment: tracker_alert.png added

Changed 9 years ago by diver

Attachment: tracker_alert_2.png added

comment:1 Changed 7 years ago by diver

Blocking: 8428 added

comment:2 Changed 7 years ago by diver

Blocking: 8428 removed

comment:3 Changed 7 years ago by diver

This is also the case for vboxsf file system.

comment:4 Changed 7 years ago by diver

Probably there should be a check for volume.IsReadOnly() in TrackerLaunchDocuments() in FSUtils.cpp.

comment:5 Changed 6 years ago by diver

Cc: siarzhuk added
diff --git a/src/kits/tracker/FSUtils.cpp b/src/kits/tracker/FSUtils.cpp
index 8a75bbc..152731f 100644
--- a/src/kits/tracker/FSUtils.cpp
+++ b/src/kits/tracker/FSUtils.cpp
@@ -3469,7 +3469,8 @@ _TrackerLaunchDocuments(const entry_ref* /*doNotUse*/, const BMessage* refs,
                                "The file is mistakenly marked as executable. "));
                        alertString.ReplaceFirst("%name", app.name);
 
-                       if (!openWithOK) {
+                       BVolume volume(documentRef.device);
+                       if (!openWithOK && !volume.IsReadOnly()) {
                                // offer the possibility to change the permissions
 
                                alertString << B_TRANSLATE("\nShould this be fixed?");

With the above change launching a file fails with "The file is mistakenly marked as executable." error.

comment:6 Changed 6 years ago by jessicah

I think the better fix in the case of a read-only file-system would be to set some sort of flag to ignore the executable bit to emulate what happens when retrying after successfully unsetting the executable bit on a writeable file-system.

comment:7 Changed 2 years ago by axeld

Owner: changed from axeld to nobody
Status: newassigned
Note: See TracTickets for help on using tickets.