[From nobody Sat May 30 13:05:06 2026
Received: (at submit) by bugs.debian.org; 3 Jun 2024 01:41:05 +0000
X-Spam-Checker-Version: SpamAssassin 3.4.6-bugs.debian.org_2005_01_02
 (2021-04-09) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-11.9 required=4.0 tests=BAYES_00,
 BODY_INCLUDES_PACKAGE,FOURLA,HAS_PACKAGE,SPF_HELO_NONE,SPF_PASS,
 T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no
 version=3.4.6-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 12; hammy, 150; neutral, 170; spammy,
 0. spammytokens: hammytokens:0.000-+--trixie, 0.000-+--cutf8,
 0.000-+--CUTF8, 0.000-+--c.utf-8, 0.000-+--UD:C.UTF-8
Return-path: &lt;vincent@vinc17.net&gt;
Received: from joooj.vinc17.net ([155.133.131.76]:60264)
 by buxtehude.debian.org with esmtps
 (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.94.2) (envelope-from &lt;vincent@vinc17.net&gt;)
 id 1sDwh5-009C4K-SP
 for submit@bugs.debian.org; Mon, 03 Jun 2024 01:41:05 +0000
Received: from smtp-qaa.vinc17.net
 (2a02-8428-1b1d-4d01-96a9-491d-7b48-ba31.rev.sfr.net
 [IPv6:2a02:8428:1b1d:4d01:96a9:491d:7b48:ba31])
 by joooj.vinc17.net (Postfix) with ESMTPSA id BEAF5323;
 Mon,  3 Jun 2024 03:40:58 +0200 (CEST)
Received: by qaa.vinc17.org (Postfix, from userid 1000)
 id 8DF69CA00ED; Mon, 03 Jun 2024 03:40:58 +0200 (CEST)
Date: Mon, 3 Jun 2024 03:40:58 +0200
From: Vincent Lefevre &lt;vincent@vinc17.net&gt;
To: Debian Bug Tracking System &lt;submit@bugs.debian.org&gt;
Subject: lynx: does not discard output from mailcap test
Message-ID: &lt;20240603014058.GA435600@qaa.vinc17.org&gt;
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
X-Reportbug-Version: 13.0.1
X-Mailer-Info: https://www.vinc17.net/mutt/
User-Agent: Mutt/2.2.13+76 (1f3da810) vl-167818 (2024-04-20)
Delivered-To: submit@bugs.debian.org

Package: lynx
Version: 2.9.2-1
Severity: important

lynx does not discard output from mailcap test, so that &quot;lynx -dump&quot;
generates incorrect output.

With mailcap 3.71:

$ lynx -dump /dev/null
/bin/atril
/usr/bin/emacs
/usr/bin/emacs
/bin/gimp-2.10
/bin/baobab
/bin/eog
/bin/evince
/bin/inkscape
/bin/wireshark

because /etc/mailcap now has lines like

application/pdf; atril %s; test=command -v atril &amp;&amp; test -n &quot;$DISPLAY&quot;

where &quot;command -v atril&quot; outputs &quot;/bin/atril&quot;.

I can see from strace output that lynx executes

434913 execve(&quot;/bin/sh&quot;, [&quot;sh&quot;, &quot;-c&quot;, &quot;--&quot;, &quot;command -v atril &amp;&amp; test -n \&quot;$DISPLAY\&quot;&quot;], 0x55b606914990 /* 137 vars */ &lt;unfinished ...&gt;

and so on.

As a comparison, run-mailcap discards stdout and stderr:

        if ($match =~ m/;\s*test=(.*?)\s*($|;)/) {
            my $test;
            print STDERR &quot; - running test: $1 &quot; if $debug;
            $test   = system &quot;$1 &gt;/dev/null 2&gt;&amp;1&quot;;

-- System Information:
Debian Release: trixie/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable-debug'), (500, 'proposed-updates-debug'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 6.7.12-amd64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages lynx depends on:
ii  libbrotli1      1.1.0-2+b3
ii  libbsd0         0.12.2-1
ii  libbz2-1.0      1.0.8-5.1
ii  libc6           2.38-12
ii  libgnutls30t64  3.8.5-4
ii  libidn2-0       2.3.7-2
ii  libncursesw6    6.5-2
ii  libtinfo6       6.5-2
ii  lynx-common     2.9.2-1
ii  zlib1g          1:1.3.dfsg-3.1

Versions of packages lynx recommends:
ii  mailcap  3.71

lynx suggests no packages.

-- no debconf information

-- 
Vincent Lefèvre &lt;vincent@vinc17.net&gt; - Web: &lt;https://www.vinc17.net/&gt;
100% accessible validated (X)HTML - Blog: &lt;https://www.vinc17.net/blog/&gt;
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
]