[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[pkg-wine-party] Bug#819255: nothing depends on wine-binfmt



control: tags -1 pending

Hi all,

On 01/19/2018 08:41 PM, Adam Borowski wrote:
>> This has also been brought up upstream in #39884 for their packages, and
>> is now being discussed in wine-devel
> 
> The discussion ended without a conclussion, be it for yes or for no.
> 
> Upstream's packages are monolithic, though, without a separate binfmt
> package, thus it's a valid dilemma there.  Your packaging is different.
> 
>> We might also add a low priority debconf question (default false) to
>> setup the binfmt support.
> 
> I just realized: as there's nothing that can make wine-binfmt automatically
> installed (the only relationships are Suggests:), this question has already
> been answered by the user: they made the manual step of installing this
> package.  On Debian, it is split out, and has no other contents than the
> binfmt.
> 
> Thus, every user who would want to answer "no" to such a debconf question
> wouldn't install the package.

I reread #733556 (binfmt-support got lost for PE32+) and follow-up bugs,
which already have some discussion of this topic.  They discuss the
security risks, and the risk of running an application already installed
in another prefix in the wrong prefix.  The 64-/32-bit issues mentioned
in these bugs are solved by the current Wine setup.  It seems nobody
explicitly objected activating binfmt-support as long as it is in a
separate package.

So I agree with Adam, and therefore committed the needed postinst and
prerm scripts to git (also attached to this mail).

I will not make an upload with these changes for at least 2 weeks, to
give everyone a chance to raise their voice.

I also updated the package description and the README, and added a NEWS
entry.  Please have a look at them, and tell me what you think.

Greets
jre
diff --git a/debian/NEWS b/debian/NEWS
index d632c989b3..d8b9e371ae 100644
--- a/debian/NEWS
+++ b/debian/NEWS
@@ -1,3 +1,19 @@
+wine (3.0-2) unstable; urgency=medium
+
+  The package wine-binfmt (not part of a standard Wine installation) will now
+  automatically register Wine as interpreter for Windows executables.  This
+  causes Wine to be invoked automatically whenever a matching file is executed.
+  (Previously wine-binfmt only installed support for this, but you still needed
+  to activate it manually.)
+
+  Warning: This increases the risk of inadvertently launching Windows malware,
+  so please make sure that you understand the security risks before installing
+  this package.
+
+  For more information please refer to Wine's README.debian.
+
+ -- Jens Reyer <jre.winesim@gmail.com>  Sun, 28 Jan 2018 18:51:42 +0100
+
 wine-development (1.9.16-1) unstable; urgency=medium
 
   Debian has two sets of Wine packages: wine and wine-development. They now use
diff --git a/debian/README.debian b/debian/README.debian
index a4a093cc1f..15f650a15e 100644
--- a/debian/README.debian
+++ b/debian/README.debian
@@ -175,42 +175,55 @@ make sure that you understand the security risks before blindly setting this
 up.
 
 
-You can directly launch Windows executables from the command line if they have
-the executable bit set, and if they are either in PATH or you specify the path
-to them.
-
-To configure backend support for that, you'll need to execute:
-$ sudo apt install wine-binfmt
-$ sudo update-binfmts --import wine
-
-To remove this backend support again execute:
-$ sudo update-binfmts --package wine --remove wine /usr/bin/wine
-
-
-You can also make Wine known to your desktop environment.  Then you may for
-example in a filebrowser double-click on Windows executables to start them, or
-right-click on them to "Open With Wine Windows Programs Loader".
-
-Wine does this automatically for most file types supported by your installed
-Windows applications.  However this is disabled for basic ones in Debian, both
-for security reasons and to avoid unwanted associations with Wine while a
-preferred native application exists.
-
-To enable system-wide support for .exe files execute the following command
-(replace /usr/share/doc/wine with /usr/share/doc/wine-development if you use
-wine-development):
+System integration (binfmt)
+---------------------------
+If you install the package wine-binfmt Wine gets registered as interpreter for
+Windows executables.  So instead of executing "wine foo.exe" you may just use
+"./foo.exe".  Windows executables (including malware) might get auto-started
+this way, even as root.  For this to work, the executable has to be on PATH (or
+its path must be specified), and the executable mode bit must be set.
+
+This feature is probably most interesting for automatic software testing.
+Desktop users probably don't need it, so don't install wine-binfmt, unless you
+know that you need it.
+
+
+Desktop integration
+-------------------
+To make Wine known to your desktop environment you can install a wine.desktop
+file.  Then you may e.g. double-click on Windows executables in a filebrowser
+to start them, or right-click on them to "Open With Wine Windows Programs
+Loader".
+
+Enable system-wide:
 $ sudo cp /usr/share/doc/wine/examples/wine.desktop /usr/share/applications/
+or
+$ sudo cp /usr/share/doc/wine-development/examples/wine.desktop /usr/share/applications/
 
-To support this only for your current user execute:
+Enable only for your current user:
 $ cp /usr/share/doc/wine/examples/wine.desktop ~/.local/share/applications/
 
-To remove these native file type associations again execute the following
-commands:
+Remove:
 $ sudo rm -f /usr/share/applications/wine.desktop
 $ sudo update-desktop-database
 $ rm -f ~/.local/share/applications/wine.desktop
-$ rm -f ~/.local/share/applications/wine-extension-*
 $ update-desktop-database ~/.local/share/applications/
 
-The Wine FAQ has further information about this topic.
 
+Opening files with Windows applications (MIME)
+----------------------------------------------
+Some applications register for opening files of a specified type.  Generally
+these associations are propagated to your Linux desktop, so that you can
+directly open files with the matching Windows application.  However it is
+disabled for some common file types to avoid unwanted associations with
+general purpose Windows applications, while a preferred native application
+exists (e.g. it prevents .txt files from being opened with Wine's notepad
+instead of your system's preferred editor).
+
+To remove all these file type associations:
+
+$ rm -rf ~/.local/share/applications/wine/
+$ rm -f ~/.local/share/applications/wine-extension-*
+$ update-desktop-database ~/.local/share/applications/
+
+The Wine FAQ has further information on this topic.
diff --git a/debian/control.in b/debian/control.in
index fa0bf574e7..efe199e49c 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -300,11 +300,21 @@ Breaks:
  wine1.6 (<< 1:1.8.4ubuntu1~),
 Replaces:
  wine1.6 (<< 1:1.8.4ubuntu1~),
-Description: Windows API implementation - binfmt support
+Description: Activate Wine as interpreter for Windows executables 
  Wine is a free MS-Windows API implementation.
  This is still a work in progress and many applications may still not work.
  .
- This package provides support for launching Windows executables directly.
+ This package registers Wine as interpreter for Windows executables, using
+ the kernel binfmt_misc module.  This causes Wine to be invoked automatically
+ whenever a matching file is executed.
+ .
+ WARNING:  This increases the risk of inadvertently launching Windows
+ malware, so please make sure that you understand the security risks before
+ blindly installing this package.
+ .
+ This feature is probably most interesting for automatic software testing.
+ Desktop users usually don't need it, so don't install wine-binfmt unless you
+ know that you need it.  Refer to Wine's README.debian for more information.
 
 Package: fonts-wine
 Section: fonts
diff --git a/debian/wine-binfmt.postinst b/debian/wine-binfmt.postinst
new file mode 100644
index 0000000000..9d8ea71197
--- /dev/null
+++ b/debian/wine-binfmt.postinst
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+    configure)
+        update-binfmts --import wine
+        ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/wine-binfmt.prerm b/debian/wine-binfmt.prerm
new file mode 100644
index 0000000000..17224687a2
--- /dev/null
+++ b/debian/wine-binfmt.prerm
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+    remove|deconfigure)
+        update-binfmts --package wine --remove wine /usr/bin/wine
+        ;;
+esac
+
+#DEBHELPER#
+
+exit 0

Reply to: