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 524270 - handle autorun.exe and autorun.inf on media
handle autorun.exe and autorun.inf on media
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: [obsolete] GIO
2.22.x
Other Linux
: Low enhancement
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 573242 579436 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-03-25 09:54 UTC by Sebastien Bacher
Modified: 2010-10-18 22:12 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
patch (6.57 KB, patch)
2008-03-26 01:05 UTC, Cosimo Cecchi
rejected Details | Review
patch v2 (2.78 KB, patch)
2008-04-05 01:33 UTC, Cosimo Cecchi
committed Details | Review

Description Sebastien Bacher 2008-03-25 09:54:10 UTC
* insert an ubuntu CD in the drive
* notice the autorun dialog which is opened
* click on launch

you can an error saying that nautilus could not find the autorun program, there is an autorun.inf pointing to a win exe which can't be used under linux if you don't have wine installed, it should not start the autorun dialog
Comment 1 Cosimo Cecchi 2008-03-26 01:05:03 UTC
Created attachment 108035 [details] [review]
patch

Attached patch modifies nautilus-autorun.c and nautilus-autorun-sofyware.c to just do nothing instead of opening dialogs when they find autorun.exe and autorun.inf files.
Comment 2 Christian Neumair 2008-04-04 16:18:13 UTC
Thanks for your work Cosimo!

However, I am rejecting attachment 108035 [details] [review]. Removing the autorun code is not a solution.

nautilus-autorun-software should simply support executables. Renaming bug report to "handle autorun.exe and autorun.inf on media".
Comment 3 Sebastien Bacher 2008-04-04 20:38:58 UTC
not sure I agree there, those are not linux format so you can try using wine but when this one is not installed?
Comment 4 Christian Neumair 2008-04-04 21:08:29 UTC
Yes, that is the idea. If wine is installed, we can use it to execute the binary, otherwise we just do nothing.
Comment 5 Sebastien Bacher 2008-04-04 21:26:20 UTC
how many users will have wine installed and does it work correctly? wouldn't it be better to disable this code until it's fixed and let a todo comment in the code rather than annoy all the unix users about something they don't use?
Comment 6 Christian Neumair 2008-04-04 21:57:54 UTC
> wouldn't it be better to disable this code until it's fixed

I am fine with disabling code for now, but the proposed patch heavily modifies the nautilus-autorun-software source code, which is not required, and somewhat messes up the revision history of the autorun code - since it removes code that will later reappear 1:1 as before.

Only the libnautilus-private/nautilus-autorun.c bits of the patch are required, and instead of removing some of the code, and #if 0'ing some of it, the patch should look like

#ifdef NAUTILUS_AUTORUN_SUPPORTS_AUTORUN_EXE
static gboolean
_check_file_case_insensitive (...)
{
...
}
#endif

...

if (... ||
#ifdef NAUTILUS_AUTORUN_SUPPORTS_AUTORUN_EXE
    _check_file_case_insensitive(...) ||
    _check_file_case_insensitive(...) ||)
#else
    0)
#endif
Comment 7 Cosimo Cecchi 2008-04-05 01:33:52 UTC
Created attachment 108653 [details] [review]
patch v2

Chistian, you're right about the approach, I like much better what you propose. Here's an updated patch. I tested it and it works fine. I also kept the leak fixes in nautilus-autorun-software.c, so that they don't get lost.
Comment 8 Christian Neumair 2008-04-05 09:48:00 UTC
Thanks for updating the patch.

While the leaks do not really matter since we will quit the application, plugging them is best practice. Please ensure to also add

g_object_unref (file);
g_object_unref (monitor);

between

present_autorun_for_software_dialog (mount);

and

g_object_unref (mount);

and commit the patch with these modifications.
Comment 9 Cosimo Cecchi 2008-04-05 10:14:58 UTC
I committed that patch with those modifications.
Leaving this bug opened for proper .exe support, but modifying severity to enhancement.
Comment 10 A. Walton 2008-04-05 14:33:11 UTC
if (file == NULL) {
g_object_unref (monitor);
goto out;
}

is dead code. All of the GFile commands are guaranteed to give you a GFile, just not a good one (e.g. you might get a GDummyFile).
Comment 11 Cosimo Cecchi 2009-03-09 12:39:10 UTC
*** Bug 573242 has been marked as a duplicate of this bug. ***
Comment 12 Sebastien Bacher 2009-03-09 13:45:45 UTC
the bug is back in GNOME 2.25
Comment 13 Cosimo Cecchi 2009-03-09 16:25:12 UTC
I will commit a proper fix to Nautilus once the patch at https://bugs.freedesktop.org/show_bug.cgi?id=20562 will land in shared-mime-info.
Comment 14 Cosimo Cecchi 2009-04-21 11:23:44 UTC
*** Bug 579436 has been marked as a duplicate of this bug. ***
Comment 15 Cosimo Cecchi 2009-04-23 18:02:50 UTC
This is now fixed in master; if you use CVS shared-mime-info, autorun won't popup for Win32 software.

commit cffb9cf70254086a3737b37e8fad786a6e6de414
Author: Cosimo Cecchi <cosimoc@gnome.org>
Date:   Thu Apr 23 19:57:09 2009 +0200

    Don't show autorun hints for Win32 software media
    
    Now that shared-mime-info supports "x-content/win32-software" vs
    "x-content/unix-software", use this distinction to inhibit autorun
    prompts/hints for media containing Win32 software (#524270).
Comment 16 mads 2010-10-05 19:14:43 UTC
A history from my point of view: I had a hard time trying to find out why Nautilus opened some CDs when they were inserted while it was completely silent for others. Was it a configuration error or a bug? Was it udev? (Partly, yes, but that got fixed.) Was it udisks? gdu? gvfs? No; it was because the "a device has been mounted" message contained "x-content/win32-software", and that made nautilus silently ignore the device. I would like to see that changed.

I think it should be possible to "browse" drives even though they happens to also have windows autorun. If win32 can be handled through wine then fine, but I think that it by default shouldn't be treated special in any way, neither to autorun nor to be ignored. It should just open like all other drives with files.

Nautilus generally seems to be very configurable, but _if_ handling of this content type has to be hardcoded, then I think it should be done in nautilus_autorun_launch_for_mount and not as the first thing in do_autorun_for_content_type. Could you as a minimal fix please consider moving it? And perhaps give some kind of notice when it is ignored?

(It is possible that a prettier solution would be if the mount message also contained something like "x-convent/this-is-also-a-browsable-file-system" and nautilus had to choose/ask which of these roles that should be used. But that is apparently not how the API is, and changing the API might be a bigger task.)
Comment 17 mads 2010-10-18 22:12:15 UTC
I have filed bug 632510 with a patch.