Package: binfmt-support
Version: 2.1.8-2.1

Using update-binfmts with the same magic and fix-binary twice, will
install the detector on the second call. However, this breaks fix-binary
since the whole point of fixed binary is to allow to use the interpreter
inside a container/chroot. If a detector is in the play, this detector
won't be able to load the interpreter from inside the container/chroot.

I think it would be more sensible for binfmt-support to warn the user on
the second invocation.

E.g. something like this:

--- a/src/update-binfmts.c
+++ b/src/update-binfmts.c
@@ -323,6 +326,11 @@ static int act_enable (const char *name)
                if (!strcmp (format_kvelem->key, name))
                    continue;
                if (binfmt_equals (binfmt, format_kvelem->value)) {
+                   if (binfmt->fix_binary && !strcmp
(binfmt->fix_binary, "yes")) {
+                       warning_err ("magic already exists. When using
+                                       fixed binary magic must be
unique.");
+                       return 0;
+                   }
                    need_detector = 1;
                    break;
                }

Reply via email to