GNOME Bugzilla – Bug 524270
handle autorun.exe and autorun.inf on media
Last modified: 2010-10-18 22:12:15 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
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.
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".
not sure I agree there, those are not linux format so you can try using wine but when this one is not installed?
Yes, that is the idea. If wine is installed, we can use it to execute the binary, otherwise we just do nothing.
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?
> 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
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.
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.
I committed that patch with those modifications. Leaving this bug opened for proper .exe support, but modifying severity to enhancement.
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).
*** Bug 573242 has been marked as a duplicate of this bug. ***
the bug is back in GNOME 2.25
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.
*** Bug 579436 has been marked as a duplicate of this bug. ***
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).
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.)
I have filed bug 632510 with a patch.