[Bug 13737] New: Execute ELF shared objects on double click

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 13737] New: Execute ELF shared objects on double click

bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=13737

            Bug ID: 13737
           Summary: Execute ELF shared objects on double click
    Classification: Xfce Core
           Product: Thunar
           Version: 1.6.12
          Hardware: PC (x86_64)
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Medium
         Component: General
          Assignee: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]
                CC: [hidden email], [hidden email]
  Target Milestone: 1.8.0

Arch Linux recently changed their default toolchain flags to a more secure
combination [1]. Most likely because of this, executables are now recognized as
shared objects, e.g., output from "file":

  a.out: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically
linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32,
BuildID[sha1]=941b4da3c6b4b43727371ae88aa0b54f6d493487, not stripped

Thunar thinks the same, and after double-clicking an executable it asks which
program to use to open a shared object. Instead, Thunar should execute these
types of files just like regular executables.

Note: some ELF shared libraries actually are also runnable as executables, for
example, "/lib/libc.so.6" on a typical Linux system.

[1] https://lists.archlinux.org/pipermail/arch-dev-public/2017-June/028903.html

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Xfce-bugs mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce-bugs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 13737] Execute ELF shared objects on double click

bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=13737

Skunnyk <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Xfce-bugs mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce-bugs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 13737] Execute ELF shared objects on double click

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=13737

liquider <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Xfce-bugs mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce-bugs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 13737] Execute ELF shared objects on double click

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=13737

Viktor Odintsev <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #1 from Viktor Odintsev <[hidden email]> ---
Created attachment 7241
  --> https://bugzilla.xfce.org/attachment.cgi?id=7241&action=edit
gfile-test.c

The problem is how actually determine whether shared lib is executable. `file
--mime-type` applied against these binaries says 'application/x-sharedlib',
g_file_query_info contains the same mime type. But in glib opinion this type is
not executable (g_content_type_can_be_executable for 'application/x-sharedlib'
will return FALSE). I'm attaching a simple program which demonstrates this
behavior.

There should be another way to check whether file is executable instead of
relying on mime type.

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Xfce-bugs mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce-bugs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 13737] Execute ELF shared objects on double click

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=13737

--- Comment #2 from Andrey Vihrov <[hidden email]> ---
I am not sure if there is any reasonable way, except treating all files with
executable bit as executables. Checking a test executable and a regular shared
library with "readelf -h" shows that they both have type "DYN (Shared object
file)" and both have an entry point.

If Thunar uses g_content_type_can_be_executable(), then perhaps I should
forward this bug report to Glib developers?

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Xfce-bugs mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce-bugs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 13737] Execute ELF shared objects on double click

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=13737

--- Comment #3 from Viktor Odintsev <[hidden email]> ---
glib developers can't solve this since not all 'application/x-sharedlib' can be
actually executed. The problem is more fundamental: even `file` utility returns
this mime type. The difference only in that executable shared libs have INTERP
header (so `file` utility prints 'interpreter /lib64/ld-linux-x86-64.so.2').

So no matter where it will be changed: in glib or in thunar directly. Replying
on mime type now is bad idea (but thunar does it).

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Xfce-bugs mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce-bugs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 13737] Execute ELF shared objects on double click

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=13737

--- Comment #4 from Andrey Vihrov <[hidden email]> ---
Note that not all executables will have an interpreter section. For example,
statically linked executables do not have it.

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Xfce-bugs mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce-bugs
Loading...