From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#35495: 27.0.50; Untarring an archive with a keyring.gpg inside Date: Thu, 09 May 2019 20:24:02 -0400 Message-ID: References: <87imuk4m7u.fsf@gmail.com> <871s179qsl.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="106123"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 35495@debbugs.gnu.org, Daiki Ueno To: Federico Tedin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 10 02:25:11 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hOtLb-000RUQ-Mh for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 May 2019 02:25:11 +0200 Original-Received: from localhost ([127.0.0.1]:34554 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOtLa-0000j3-KC for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 May 2019 20:25:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOtLT-0000iy-Oy for bug-gnu-emacs@gnu.org; Thu, 09 May 2019 20:25:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOtLS-0004ua-Qr for bug-gnu-emacs@gnu.org; Thu, 09 May 2019 20:25:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51414) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hOtLS-0004uU-NQ for bug-gnu-emacs@gnu.org; Thu, 09 May 2019 20:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hOtLS-00068G-Ig for bug-gnu-emacs@gnu.org; Thu, 09 May 2019 20:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 May 2019 00:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35495 X-GNU-PR-Package: emacs Original-Received: via spool by 35495-submit@debbugs.gnu.org id=B35495.155744784823503 (code B ref 35495); Fri, 10 May 2019 00:25:02 +0000 Original-Received: (at 35495) by debbugs.gnu.org; 10 May 2019 00:24:08 +0000 Original-Received: from localhost ([127.0.0.1]:36725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOtKa-000671-BC for submit@debbugs.gnu.org; Thu, 09 May 2019 20:24:08 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:43238) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOtKX-00066s-LK for 35495@debbugs.gnu.org; Thu, 09 May 2019 20:24:07 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id x4A0O3u6027193; Thu, 9 May 2019 20:24:03 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id B790266259; Thu, 9 May 2019 20:24:02 -0400 (EDT) In-Reply-To: <871s179qsl.fsf@gmail.com> (Federico Tedin's message of "Thu, 09 May 2019 20:00:42 -0300") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6543=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6543> : inlines <7074> : streams <1821069> : uri <2842518> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:159011 Archived-At: > It looks like `jka-compr-write-region` does not do any compression if > `file`'s extension does not match any of the extensions defined in > `jka-compr-compression-info-list`. Writing to a file ending in ".gpg" > just uses `epa-file-handler`, then. Yes, of course, but the question is what it does when the tar's content has a name that ends in `.gz` or something like that. I now see that it has a hack in write-region which looks at the contents to detect if it's already compressed. [ I guess this can lead to problem in odd cases such as when you manipulate a file of type "foo.mypkg" where mypkg is defined as a format that is always gz-compressed: if you save it as "foo.mypkg.gz" jka-compr won't re-compress it, but then when you open it, it will uncompress it before trying to handle it as a ".mypkg" at which point the mypkg tool might signal an error because it expected the ".mypkg" to be compressed. If this will ever happen is anyone's guess, but it look sufficiently contrived that I'm not too worried. ] > I found that `tar-copy` has the same problem that `tar-untar-buffer` > has. However, `tar-copy` has a small check where if the source file is > compressed and the destination file should be compressed, the jka-compr > file handler is disabled, as no conversion needs to be done. Maybe > something similar could be done for .gpg files. If the file inside the > tarfile is already encrypted and it is being extracted to > .gpg, then the regular `write-region` should be used > (i.e. just copy bytes from one place to another). I think there should be a way to tell `write-region` that the content should be written as-is into the file (and hence override jka-compr and epa but not tramp). I don't think there is such a thing yet, tho, so we'll have to invent it. Stefan