From unknown Sat Aug 09 15:57:52 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#25220 <25220@debbugs.gnu.org> To: bug#25220 <25220@debbugs.gnu.org> Subject: Status: tar-untar-buffer doesn't support symlinks Reply-To: bug#25220 <25220@debbugs.gnu.org> Date: Sat, 09 Aug 2025 22:57:52 +0000 retitle 25220 tar-untar-buffer doesn't support symlinks reassign 25220 emacs submitter 25220 npostavs@users.sourceforge.net severity 25220 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 17 19:25:01 2016 Received: (at submit) by debbugs.gnu.org; 18 Dec 2016 00:25:01 +0000 Received: from localhost ([127.0.0.1]:45275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cIPHh-0005B4-4E for submit@debbugs.gnu.org; Sat, 17 Dec 2016 19:25:01 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cIPHf-0005Ar-7m for submit@debbugs.gnu.org; Sat, 17 Dec 2016 19:24:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cIPHY-0003p7-ES for submit@debbugs.gnu.org; Sat, 17 Dec 2016 19:24:53 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46690) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cIPHY-0003ox-Au for submit@debbugs.gnu.org; Sat, 17 Dec 2016 19:24:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cIPHX-0008TP-12 for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2016 19:24:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cIPHS-0003ji-4A for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2016 19:24:51 -0500 Received: from mail-it0-x236.google.com ([2607:f8b0:4001:c0b::236]:35797) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cIPHR-0003hc-TR for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2016 19:24:46 -0500 Received: by mail-it0-x236.google.com with SMTP id c20so40364618itb.0 for ; Sat, 17 Dec 2016 16:24:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version; bh=Ng9+7iwYXrzuy1gkuaTz8pRt5XC566a0Ib8fcPtygtI=; b=RSvp8fPeKOqHxxvnxCAyJHNaYMWalEhq9pnSewjgoFih3kzkDluzCtdVVEFJRonLYh KmhU5NqNDzAfxaqWfTKfHOZaU65jOY7amKfqGl7pxB7vuVCQ19XavTWUoZA7O6Nw27ID pQZLZOtLqqh5cw/9T8a+2OVbNWlsq3kb3Au3V/gwykrmBHIIf6uyMzr0NYkOWly3h3F6 TDPGIIWKzWqZ7Wkr4itngjcHDwDyh2leYG7oihjvNd89VvIdz7ThVAWdGEW9qjqWdG7W hFem5oMgKmRVFtfPFm+LjfkToUkmvJI+mJ/o1zVUPUNcPHHan+LCG+t2B04ou/s7dJ/P pPGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version; bh=Ng9+7iwYXrzuy1gkuaTz8pRt5XC566a0Ib8fcPtygtI=; b=h0LfpqxyXNfhrzPQv0YuE6VY9S1yjmk1jus+9C3zXz37C0T60MC148zXqp828WLuzd G9VTE6DgdSokelK8It6T2eN8uGES7MEzq8IqycA4gjdTeRs2XTZrlSiTHeEXaTg04Zte yNSrl7wzXemd/5CoE72vm9GJB9J9lWcQilNOL+iZFegGWhUEYJPiXoTSNb6fEhIr9Kar C2QG7KGBo/XKpWDH4ETUvgS05iY1i0u7y+XzSzZmEPXxX/VF3KcABSeFL1zMbvBxAfW+ o3Uff/t0x1oDsy6NwI8HKdwEuiuG2JkWWDrZFpve65UeZYp4Ao53QoA9CX3cBxkD/XfI HPBA== X-Gm-Message-State: AKaTC00cM/TuBDaJMt6BJpvOBvAOUWYTUbzH9fB3Nc0QMVpIVcFqwZPtiK3icqtmUSDzOQ== X-Received: by 10.36.146.134 with SMTP id l128mr10144733itd.11.1482020683595; Sat, 17 Dec 2016 16:24:43 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id 63sm5467616iof.42.2016.12.17.16.24.42 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Dec 2016 16:24:42 -0800 (PST) From: npostavs@users.sourceforge.net To: bug-gnu-emacs@gnu.org Subject: tar-untar-buffer doesn't support symlinks Date: Sat, 17 Dec 2016 19:25:47 -0500 Message-ID: <877f6yccc4.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --=-=-= Content-Type: text/plain Severity: wishlist tar-untar-buffer silently converts symlinks into regular files. There might be some portability trouble with supporting them, but at least we should warn about low fidelity unpacking, as in the patch below. This initially turned up as a yasnippet bug, because the package's tarball was using symlinks. Of course that has to be fixed by avoiding symlinks (https://github.com/joaotavora/yasnippet/issues/748). --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0001-Warn-about-incomplete-untarring-of-link-files.patch Content-Description: patch >From 43d59f8d90604cb8d65a28d99f90156da70d4718 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 17 Dec 2016 18:01:52 -0500 Subject: [PATCH] Warn about incomplete untarring of link files The current tar-mode is doesn't really support unpacking symlinks, it simply creates an empty file of the same name. * lisp/tar-mode.el (tar--describe-as-link): New function extracted from `tar--check-descriptor'. (tar-untar-buffer): Use it to warn about imperfectly untarred link files. --- lisp/tar-mode.el | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el index 0520369..cafd0ad 100644 --- a/lisp/tar-mode.el +++ b/lisp/tar-mode.el @@ -544,6 +544,7 @@ tar-untar-buffer (dir (if (eq (tar-header-link-type descriptor) 5) name (file-name-directory name))) + (link-desc (tar--describe-as-link descriptor)) (start (tar-header-data-start descriptor)) (end (+ start (tar-header-size descriptor)))) (unless (file-directory-p name) @@ -552,6 +553,10 @@ tar-untar-buffer (make-directory dir t)) (unless (file-directory-p name) (let ((coding-system-for-write 'no-conversion)) + (when link-desc + (lwarn '(tar link) :warning + "Extracted `%s', %s, as a normal file" + name link-desc)) (write-region start end name))) (set-file-modes name (tar-header-mode descriptor)))))))) @@ -816,19 +821,23 @@ tar-current-descriptor nil (error "This line does not describe a tar-file entry")))) -(defun tar--check-descriptor (descriptor) +(defun tar--describe-as-link (descriptor) (let ((link-p (tar-header-link-type descriptor))) (if link-p - (error "This is %s, not a real file" - (cond ((eq link-p 5) "a directory") - ((eq link-p 20) "a tar directory header") - ((eq link-p 28) "a next has longname") - ((eq link-p 29) "a multivolume-continuation") - ((eq link-p 35) "a sparse entry") - ((eq link-p 38) "a volume header") - ((eq link-p 55) "a pax global extended header") - ((eq link-p 72) "a pax extended header") - (t "a link")))))) + (cond ((eq link-p 5) "a directory") + ((eq link-p 20) "a tar directory header") + ((eq link-p 28) "a next has longname") + ((eq link-p 29) "a multivolume-continuation") + ((eq link-p 35) "a sparse entry") + ((eq link-p 38) "a volume header") + ((eq link-p 55) "a pax global extended header") + ((eq link-p 72) "a pax extended header") + (t "a link"))))) + +(defun tar--check-descriptor (descriptor) + (let ((link-desc (tar--describe-as-link descriptor))) + (when link-desc + (error "This is %s, not a real file" link-desc)))) (defun tar-get-descriptor () (let* ((descriptor (tar-current-descriptor)) -- 2.9.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 27 07:11:34 2019 Received: (at 25220) by debbugs.gnu.org; 27 Jul 2019 11:11:34 +0000 Received: from localhost ([127.0.0.1]:43690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hrKbt-00014w-Sm for submit@debbugs.gnu.org; Sat, 27 Jul 2019 07:11:34 -0400 Received: from quimby.gnus.org ([80.91.231.51]:36312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hrKbr-00014o-Kb for 25220@debbugs.gnu.org; Sat, 27 Jul 2019 07:11:31 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hrKbo-0006Y9-9Q; Sat, 27 Jul 2019 13:11:30 +0200 From: Lars Ingebrigtsen To: npostavs@users.sourceforge.net Subject: Re: bug#25220: tar-untar-buffer doesn't support symlinks References: <877f6yccc4.fsf@users.sourceforge.net> Date: Sat, 27 Jul 2019 13:11:27 +0200 In-Reply-To: <877f6yccc4.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Sat, 17 Dec 2016 19:25:47 -0500") Message-ID: <87imrnka00.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: npostavs@users.sourceforge.net writes: > Severity: wishlist > > tar-untar-buffer silently converts symlinks into regular files. There > might be some portability trouble with supporting them, but at least we > should warn about low fidelit [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 25220 Cc: 25220@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) npostavs@users.sourceforge.net writes: > Severity: wishlist > > tar-untar-buffer silently converts symlinks into regular files. There > might be some portability trouble with supporting them, but at least we > should warn about low fidelity unpacking, as in the patch below. > > This initially turned up as a yasnippet bug, because the package's > tarball was using symlinks. Of course that has to be fixed by avoiding > symlinks (https://github.com/joaotavora/yasnippet/issues/748). It looks like this patch was applied at the time, but the bug report wasn't closed, so I'm doing that now. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 27 07:11:41 2019 Received: (at control) by debbugs.gnu.org; 27 Jul 2019 11:11:41 +0000 Received: from localhost ([127.0.0.1]:43693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hrKc1-00015L-7w for submit@debbugs.gnu.org; Sat, 27 Jul 2019 07:11:41 -0400 Received: from quimby.gnus.org ([80.91.231.51]:36336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hrKbz-00015B-Gn for control@debbugs.gnu.org; Sat, 27 Jul 2019 07:11:39 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hrKbw-0006YI-Vg for control@debbugs.gnu.org; Sat, 27 Jul 2019 13:11:38 +0200 Date: Sat, 27 Jul 2019 13:11:36 +0200 Message-Id: <87h877k9zr.fsf@mouse.gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #25220 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 25220 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 25220 quit From unknown Sat Aug 09 15:57:52 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 24 Aug 2019 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator