NetBSD Problem Report #53541

From dholland@netbsd.org  Sun Aug 19 22:31:07 2018
Return-Path: <dholland@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 972CF7A1CE
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 19 Aug 2018 22:31:07 +0000 (UTC)
Message-Id: <20180819223107.4F77984D7B@mail.netbsd.org>
Date: Sun, 19 Aug 2018 22:31:07 +0000 (UTC)
From: dholland@NetBSD.org
Reply-To: dholland@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: gimp hijacks pdfs
X-Send-Pr-Version: 3.95

>Number:         53541
>Category:       pkg
>Synopsis:       gimp hijacks pdfs
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    adam
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 19 22:35:00 +0000 2018
>Closed-Date:    Fri Dec 21 07:15:19 +0000 2018
>Last-Modified:  Fri Dec 21 07:15:19 +0000 2018
>Originator:     David A. Holland
>Release:        NetBSD 8.99.8 (20171205) pkgsrc 20180813
>Organization:
>Environment:
System: NetBSD valkyrie 8.99.8 NetBSD 8.99.8 (VALKYRIE) #24: Tue Dec  5 17:30:57 EST 2017  dholland@valkyrie:/usr/src/sys/arch/amd64/compile/VALKYRIE amd64
Architecture: x86_64
Machine: amd64
>Description:

Building the latest gimp (or, maybe, one of the dozen or two new
things it depends on) did something that causes seamonkey, and
probably firefox as well, to always open pdf downloads in gimp without
asking what to do. This means the only way to actually *download* a
pdf is to wait for gimp to start (which takes ages), then fetch the
file by hand out of /tmp/mozilla_*, where hopefully (a) it didn't fill
/tmp, (b) has a recognizable name, and (c) hasn't been garbaged by
gimp.

This kind of hijacking is entirely unacceptable. This would be true
even if gimp were a pdf viewer.

It seems that the file /usr/pkg/share/applications/mimeinfo.cache
contains the line
	 application/pdf=gimp.desktop;
but it's not clear to me what this specifically means or why it would
suddenly cause this behavior if it hasn't in the past.

>How-To-Repeat:

make install (afaict)

>Fix:

dunno
(besides rm -rf gimp, which is an increasingly attractive proposition
as it's increasingly bloaty and user-hostile)

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->adam
Responsible-Changed-By: bsiegert@NetBSD.org
Responsible-Changed-When: Fri, 31 Aug 2018 13:55:28 +0000
Responsible-Changed-Why:
Over to maintainer.


From: Leonardo Taccari <leot@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53541: gimp hijacks pdfs
Date: Fri, 31 Aug 2018 17:13:22 +0200

 Hello David,

 dholland@NetBSD.org writes:
 > [...]
 > Building the latest gimp (or, maybe, one of the dozen or two new
 > things it depends on) did something that causes seamonkey, and
 > probably firefox as well, to always open pdf downloads in gimp without
 > asking what to do. This means the only way to actually *download* a
 > pdf is to wait for gimp to start (which takes ages), then fetch the
 > file by hand out of /tmp/mozilla_*, where hopefully (a) it didn't fill
 > /tmp, (b) has a recognizable name, and (c) hasn't been garbaged by
 > gimp.
 >
 > This kind of hijacking is entirely unacceptable. This would be true
 > even if gimp were a pdf viewer.
 >

 AFAIK (at least for www/firefox52 but I think that www/seamonkey
 is similar) this is handled via `~/.mozilla/firefox/<profile/mimeType.rdf'.

 Can you please try to `mv mimeType.rdf mimeType.rdf.bak' or similar
 and see if this avoid automatically open the PDF without prior
 asking to download?


 Thanks!

 > It seems that the file /usr/pkg/share/applications/mimeinfo.cache
 > contains the line
 > 	 application/pdf=gimp.desktop;
 > but it's not clear to me what this specifically means or why it would
 > suddenly cause this behavior if it hasn't in the past.
 > [...]

 (The following is probably mostly unrelated to the issue, so feel
 free to ignore it! :))

 I'm not sure if mimeinfo.cache is directly honored or not but I
 think all `MimeType=' in *.desktop files are. E.g. ktruss-ing
 `xdg-mime':

  % xdg-mime query default 'video/x-theora'
  mpv.desktop

 show that all *.desktop files are opened.
 Unfortunately, I think that there is not any "prority" or similar
 so if `gimp' is automa{g,t}ically picked up for application/pdf
 the only way to override that and use a different PDF viewer is to
 adjust ~/.local/share/applications/defaults.list. E.g. here I have (I
 will just trim it to a single entry, all other lines are similar):

  % cat ~/.local/share/applications/defaults.list
  [Default Applications]
  application/pdf=mupdf.desktop;

 and - because mupdf does not provide any .desktop file I have added one:

  % cat ~/.local/share/applications/mupdf.list
  [Desktop Entry]
  Version=1.0
  Encoding=UTF-8
  Type=Application
  Name=mupdf
  NoDisplay=true
  Exec=mupdf

State-Changed-From-To: open->feedback
State-Changed-By: leot@NetBSD.org
State-Changed-When: Fri, 31 Aug 2018 15:15:51 +0000
State-Changed-Why:
Possible workaround shared, feedback requested.


State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Fri, 21 Dec 2018 07:15:19 +0000
State-Changed-Why:
I tried what you suggested and it didn't work, but something else
(unfortunately I forget what now) restored the normal behavior, so
it's no longer an issue.

I don't remember why I didn't write in at the time.

It wuold be nice if such excursions didn't happen, but all this desktop
crap isn't high enough quality and we don't control it...


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.