From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 18 19:16:05 2017 Received: (at submit) by debbugs.gnu.org; 18 Sep 2017 23:16:05 +0000 Received: from localhost ([127.0.0.1]:46969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1du5Gn-0007zC-EJ for submit@debbugs.gnu.org; Mon, 18 Sep 2017 19:16:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56765) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1du53m-0007e7-Bx for submit@debbugs.gnu.org; Mon, 18 Sep 2017 19:02:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1du53f-0000r6-UJ for submit@debbugs.gnu.org; Mon, 18 Sep 2017 19:02:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,MIME_BASE64_BLANKS,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:40889) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1du53f-0000qs-QW for submit@debbugs.gnu.org; Mon, 18 Sep 2017 19:02:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1du53e-0002dd-Ln for bug-coreutils@gnu.org; Mon, 18 Sep 2017 19:02:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1du53b-0000oV-Ji for bug-coreutils@gnu.org; Mon, 18 Sep 2017 19:02:30 -0400 Received: from mail4.protonmail.ch ([185.70.40.27]:23838) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1du53b-0000mz-80 for bug-coreutils@gnu.org; Mon, 18 Sep 2017 19:02:27 -0400 Date: Mon, 18 Sep 2017 19:02:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=default; t=1505775743; bh=91qILibgXu09hTA9abvlSZqUUmj9zj74/00y7/WHKcg=; h=To:From:Reply-To:Subject:Feedback-ID:From; b=qF80H40wush2NBCsCoLNVsJsFcWuJevGkzoKf8pgRdmX+DQktWjR8ViUMWPRSot7J 1M3iiAqaQFLpwTNZu6AdKR2N0PEIM+tVnkr2swxQA2XejHsScySJ5/G0EicAblGU5x cBjz2/rlyxiduMNp0I2dPrGAkreos19Y8XCiT2zs= To: "bug-coreutils@gnu.org" From: pengu1n Subject: shred 8.28 renames files only once Message-ID: Feedback-ID: Is6mJrp7rK9ZMdiurV7NIc_3xvdVOvoJhJ1HidMIUvnoG_XQ7eh3MjZbEt7GaXad6bOKpWqH_oY_B6pW1M18nw==:Ext:ProtonMail MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="b1_292a4ad61d4819be9220ab05c7cbbbdd" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] 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-Mailman-Approved-At: Mon, 18 Sep 2017 19:16:04 -0400 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: , Reply-To: pengu1n Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) This is a multi-part message in MIME format. --b1_292a4ad61d4819be9220ab05c7cbbbdd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 SGVsbG8uCgpbY29yZXV0aWxzIDguMjddCgokIHRvdWNoIHRlc3QKJ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8YnI+PGJyPnNocmVkOiB0ZXN0OiByZW1vdmluZzxi cj5zaHJlZDogdGVzdDogcmVuYW1lZCB0byAwMDAwPGJyPnNocmVkOiB0ZXN0OiByZW1vdmVkPGJy Pjxicj5JcyBpdCBhIGJ1ZyBvciBpcyBpdCBhbiBpbnRlbnRpb25hbCBjaGFuZ2U/IEhhcyBjb21t aXQgMmFlMTQ2MGRhZDg5YTc5MWViZjc3MGY3NDIxNzU5NmI2NjQyY2VhZCBzb21ldGhpbmcgdG8g ZG8gd2l0aCB0aGlzPzxicj48YnI+VGhhbmsgeW91LjwvZGl2PjxkaXY+PGJyPjwvZGl2Pg== --b1_292a4ad61d4819be9220ab05c7cbbbdd-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 20 00:03:09 2017 Received: (at 28507-done) by debbugs.gnu.org; 20 Sep 2017 04:03:09 +0000 Received: from localhost ([127.0.0.1]:48931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1duWE9-0001AL-4b for submit@debbugs.gnu.org; Wed, 20 Sep 2017 00:03:09 -0400 Received: from mail.magicbluesmoke.com ([82.195.144.49]:35426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1duWE5-0001AA-NU for 28507-done@debbugs.gnu.org; Wed, 20 Sep 2017 00:03:06 -0400 Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net [73.158.116.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 0699110A; Wed, 20 Sep 2017 05:03:01 +0100 (IST) Subject: Re: bug#28507: shred 8.28 renames files only once To: pengu1n , 28507-done@debbugs.gnu.org References: From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <5588680b-dc3c-8f1d-840e-84256e53ea74@draigBrady.com> Date: Tue, 19 Sep 2017 21:02:59 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------E8700979DF628F27FBD4A555" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 28507-done 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: 0.0 (/) This is a multi-part message in MIME format. --------------E8700979DF628F27FBD4A555 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 18/09/17 16:02, pengu1n wrote: > Hello. > > [coreutils 8.27] > > $ touch test > $ shred -vu test > > shred: test: removing > shred: test: renamed to 0000 > shred: 0000: renamed to 000 > shred: 000: renamed to 00 > shred: 00: renamed to 0 > shred: test: removed > > [coreutils 8.28] > > $ touch test > $ shred -vu test > > shred: test: removing > shred: test: renamed to 0000 > shred: test: removed > > Is it a bug or is it an intentional change? Has commit 2ae1460dad89a791ebf770f74217596b6642cead something to do with this? Drats that's a bug. The attached should fix it. Marking this as done. thanks! Pádraig --------------E8700979DF628F27FBD4A555 Content-Type: text/x-patch; name="shred-length-obfuscate.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="shred-length-obfuscate.patch" >From e65b678b5d7effaebea82d72df7435e02424506b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Tue, 19 Sep 2017 20:56:32 -0700 Subject: [PATCH] shred: reinstate --remove file name length obfuscation This was unintentionally removed in v8.27-60-g2ae1460 * src/shred.c (wipename): Interate through all name lengths. * tests/misc/shred-remove.sh: Add test cases. * NEWS: Mention the bug fix. Fixes https://bugs.gnu.org/28507 --- NEWS | 4 ++++ src/shred.c | 1 - tests/misc/shred-remove.sh | 20 ++++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 4ebe3c6..15ae40b 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,10 @@ GNU coreutils NEWS -*- outline -*- ptx -S no longer infloops for a pattern which returns zero-length matches. [the bug dates back to the initial implementation] + shred --remove will again repeatedly rename files with shortening names + to attempt to hide the original length of the file name. + [bug introduced in coreutils-8.28] + * Noteworthy changes in release 8.28 (2017-09-01) [stable] diff --git a/src/shred.c b/src/shred.c index d1d3883..f2b5d27 100644 --- a/src/shred.c +++ b/src/shred.c @@ -1117,7 +1117,6 @@ wipename (char *oldname, char const *qoldname, struct Options const *flags) first = false; } memcpy (oldname + (base - newname), base, len + 1); - break; } } diff --git a/tests/misc/shred-remove.sh b/tests/misc/shred-remove.sh index 985a4ab..546c354 100755 --- a/tests/misc/shred-remove.sh +++ b/tests/misc/shred-remove.sh @@ -44,4 +44,24 @@ done touch $file || framework_failure_ returns_ 1 shred -n0 --remove=none $file 2>/dev/null || fail=1 +# Ensure rename passes complete. +# coreutils-8.28 did not do the decreasing length rename +# which may have leaked the length of the removed file name +printf 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_. | +sed 's/./&\n/g' | xargs touch || framework_failure_ # test level exhaustion +touch test 000 || framework_failure_ # test level increment +shred -vu test 2>out || fail=1 +cat <<\EOF >exp || framework_failure_ +shred: test: removing +shred: test: renamed to 0000 +shred: 0000: renamed to 001 +shred: 001: renamed to 00 +shred: test: removed +EOF +compare out exp || fail=1 + +# Ensure renames are only retried for EEXIST +mkdir rodir && cd rodir && touch $file && chmod a-w . || framework_failure_ +returns_ 1 timeout 10 shred -u $file || fail=1 + Exit $fail -- 2.9.3 --------------E8700979DF628F27FBD4A555-- From unknown Sat Aug 16 18:43:34 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 18 Oct 2017 11:24:03 +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