From unknown Fri Jun 20 07:16:34 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#52049 <52049@debbugs.gnu.org> To: bug#52049 <52049@debbugs.gnu.org> Subject: Status: Bug in shred -u Reply-To: bug#52049 <52049@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:16:34 +0000 retitle 52049 Bug in shred -u reassign 52049 coreutils submitter 52049 David McLaughlin severity 52049 normal tag 52049 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 22 19:47:42 2021 Received: (at submit) by debbugs.gnu.org; 23 Nov 2021 00:47:42 +0000 Received: from localhost ([127.0.0.1]:49439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpJyE-000078-Ql for submit@debbugs.gnu.org; Mon, 22 Nov 2021 19:47:42 -0500 Received: from lists.gnu.org ([209.51.188.17]:42032) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpIde-0006J7-Oc for submit@debbugs.gnu.org; Mon, 22 Nov 2021 18:22:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50968) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpIde-000733-7r for bug-coreutils@gnu.org; Mon, 22 Nov 2021 18:22:18 -0500 Received: from [2a00:1450:4864:20::535] (port=37856 helo=mail-ed1-x535.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mpIdc-0001e1-6p for bug-coreutils@gnu.org; Mon, 22 Nov 2021 18:22:17 -0500 Received: by mail-ed1-x535.google.com with SMTP id e3so83857634edu.4 for ; Mon, 22 Nov 2021 15:22:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=theredx.com; s=google2; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=nUZQBb3lpvzzRYlSVQYkr7WVPpLc6bf16EyNp07oN+s=; b=g69aBxoMkVYyg3ZIgrGBZwWvEyVr9XFjzmY1temGUe5Yq+CL4WZ2z9jIUtuAOmZXa8 mqOuqVlHew+dzkX5A7RVymPn5hY0E7eANQJU58NIJ2htpKA5yNynOFTpCEiwkZLfpbzh Ln8ejG/V3JImD6i/c3PdPvEkyxpE4ckICs61B6VczJ/7v6TvwP6Ez7WifBQpKbxk3Toi f77/e8G6ZbfAa+P+s39HdVqvhEa/6o7kHaTkCR2e3gPEJEVSaKSIxTfnFaPJF5fpZ8pe sb9j/E0JlCAQrWzs1O+DUKwcBwxbVihjWCAclibWBubLk8e8d9J1lKgPRqVIag3gKvJ3 fiCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=nUZQBb3lpvzzRYlSVQYkr7WVPpLc6bf16EyNp07oN+s=; b=NouBVv4FSYsED/df4GcL4INtLA6JjFdoYncv5+ZR/m9xF0wtaRzTV0oDv3JR1aNKwL fuZw1kx/ln1FZRkSgwik0DPR9ZdtRcqStRa8za+l2526SM3TgDMFiPmnGo+v3lux0VH5 4vGQeye29bbgcjt8CupjNVQS14duFfmoRcUcYEdYaM9G+cS9hBclYolMb3cDtCCGiOtU I48gnQ2kMuDfpNlq0nK6mi0UHE25fMcn+ITvQfzb9aGt0KKU0tOnNAzk7Xue/tbG0L1h Z3DlWDfTM1e1Gh5N15DxnkZSpWvQoZV8Zvrk1MovIkl1+Tvq5p6ACEMGHfLEBBSt8I8O H52w== X-Gm-Message-State: AOAM532e/42RT/vnuaPynhtLV9v/jSCdb5n/vOqhGPEnI0sMtZkly2Ym JWlk31MLUEkWN7oRPEhG5u2jvHuhAtPDcuRpDLpgVWFOhzM= X-Google-Smtp-Source: ABdhPJyfuninJPBXcjkDNJdxNJ6jQF7SOATxP/6I/7iIYvjXupWPe2EFFcraDYwk33rHXOTsf145ig4woVLw1n8HAyM= X-Received: by 2002:a05:6402:50d4:: with SMTP id h20mr1560121edb.52.1637623333885; Mon, 22 Nov 2021 15:22:13 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: David McLaughlin Date: Mon, 22 Nov 2021 16:21:37 -0700 Message-ID: Subject: Re: Bug in shred -u To: bug-coreutils@gnu.org Content-Type: multipart/alternative; boundary="00000000000017b24905d168e567" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::535 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=david.mclaughlin@theredx.com; helo=mail-ed1-x535.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 22 Nov 2021 19:47:37 -0500 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: -2.3 (--) --00000000000017b24905d168e567 Content-Type: text/plain; charset="UTF-8" Sorry. I thought I was on 20.04 Ubuntu, but reading my report of a bug, I was not. Please disregard this, as there is no failure on more current OSs. On Mon, Nov 22, 2021 at 3:20 PM David McLaughlin < david.mclaughlin@theredx.com> wrote: > Hello, > > It seems that shred utilizes a pattern of renaming and then unlinking. > However, I don't see the use of a lock for this pattern and so there is a > race condition and the shred command can fail. This test case is timing > sensitive, and therefore doesn't happen every time. But it happens > frequently. I am trying to write robust code that depends on shred and I > find this issue is problematic. > > Test case: > $ touch a b c && for file in a b c; do shred -u -n 1 $file & done && wait > [1] 28262 > [2] 28263 > [3] 28264 > shred: c: failed to remove: No such file or directory > [1] Done shred -u -n 1 "$file" > [2]- Done shred -u -n 1 "$file" > [3]+ Exit 1 shred -u -n 1 "$file" > > > Other information: > $ shred --version > shred (GNU coreutils) 8.21 > Copyright (C) 2013 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later < > http://gnu.org/licenses/gpl.html>. > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. > > Written by Colin Plumb. > > $ cat /etc/os-release > NAME="Ubuntu" > VERSION="14.04.6 LTS, Trusty Tahr" > ID=ubuntu > ID_LIKE=debian > PRETTY_NAME="Ubuntu 14.04.6 LTS" > VERSION_ID="14.04" > HOME_URL="http://www.ubuntu.com/" > SUPPORT_URL="http://help.ubuntu.com/" > BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/" > > $ bash --version > GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu) > Copyright (C) 2013 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later < > http://gnu.org/licenses/gpl.html> > > This is free software; you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. > --00000000000017b24905d168e567 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Sorry. I thought I was on 20.04 Ubuntu, but reading m= y report of a bug, I was not.
Please disregard this, as there is = no failure on more current OSs.

On Mon, Nov 22, 2021 at 3:20 PM Da= vid McLaughlin <david.mc= laughlin@theredx.com> wrote:
Hello,

I= t seems that shred utilizes a pattern of renaming and then unlinking.
=
However, I don't see the use of a lock for this pattern and so the= re is a race condition and the shred command can fail. This test case is ti= ming sensitive, and therefore doesn't happen every time. But it happens= frequently. I am trying to write robust code that depends on shred and I f= ind this issue is problematic.

Test case:
$ touch a b c && for file in a b c; do shred -u -n 1 $file &a= mp; done && wait
[1] 28262
[2] 28263
[3] 28264
shred: c= : failed to remove: No such file or directory
[1] =C2=A0 Done =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0shred -u -n 1 &q= uot;$file"
[2]- =C2=A0Done =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0shred -u -n 1 "$file"
[3]+ =C2= =A0Exit 1 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0shr= ed -u -n 1 "$file"


Other = information:
$ shred --version
shred (GNU coreutils) 8.21
C= opyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL= version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free softw= are: you are free to change and redistribute it.
There is NO WARRANTY, t= o the extent permitted by law.

Written by Colin Plumb.
$ cat /etc/os-release
NAME=3D"Ubuntu"
VERSION= =3D"14.04.6 LTS, Trusty Tahr"
ID=3Dubuntu
ID_LIKE=3Ddebian<= br>PRETTY_NAME=3D"Ubuntu 14.04.6 LTS"
VERSION_ID=3D"14.04= "
HOME_URL=3D"http://www.ubuntu.com/"
SUPPORT_URL=3D"http://help.ubuntu.com/"BUG_REPORT_URL=3D"http://bugs.launchpad.net/ubuntu/"

$ bash --version
GNU bash, version 4.3.11(1)-release (x86_64-pc-= linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License = GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

= This is free software; you are free to change and redistribute it.
There= is NO WARRANTY, to the extent permitted by law.
--00000000000017b24905d168e567-- From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 22 20:22:11 2021 Received: (at 52049) by debbugs.gnu.org; 23 Nov 2021 01:22:12 +0000 Received: from localhost ([127.0.0.1]:49456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpKVf-0000yQ-NP for submit@debbugs.gnu.org; Mon, 22 Nov 2021 20:22:11 -0500 Received: from mail-ed1-f44.google.com ([209.85.208.44]:35773) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpKVa-0000xs-V1 for 52049@debbugs.gnu.org; Mon, 22 Nov 2021 20:22:11 -0500 Received: by mail-ed1-f44.google.com with SMTP id v1so51149928edx.2 for <52049@debbugs.gnu.org>; Mon, 22 Nov 2021 17:22:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=theredx.com; s=google2; h=mime-version:from:date:message-id:subject:to; bh=rl+sP8LbNucD+QupnRN/Ug2pzqZYbaeFFYIKAqncwJk=; b=GPanOK8ekL+YLzDEY9tjqzYz8xgIWC9i7KvBSKOgDrKlO6RW1dUySBZPT1KeRjLGnL oGeZpXYO6OSWM5hY8D+vK6ko4+BHwpUOXl986sARd70r5FLEtOEN3nPEfZp0cWNQrSWg yXPifuFWXIr2pbjEediQYa0cvNGgscrxj/yZeawEz1LiqZsLz0jisTCTARGoizk5b3ua rkFrJqM1FGZb0Zi4I6Vied2Yh8Jk5td9ZwQmcBdLxzGDrHceVg1DzYRdRzE77L62Gmlq CaihXSeJ7OXasKdBBvEjTw26SF2BniZ3sR+J4RBbpISZXqoYSKaqEGvH+R2KVwwkUnL3 ToFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=rl+sP8LbNucD+QupnRN/Ug2pzqZYbaeFFYIKAqncwJk=; b=Crcb1/j5OGWcwFyIsZgqTTMYunR+HndV0ltzpLhyVxetxRV4gsGDWXIilwVCwtzHR+ o7Q8wX3Vvr75ggSMsl8zeecK4DK1+3xBnLOnb+7tT8qVRYlTJQqB5C8Cfci3Dlj9Ej73 LZ4+q02gIcsjVBC91vmHVwbTLLuWsoGPccJkCS+I3+VTxvmsgLI1EBdvWIVUMZYPKxM/ 9pFJL0ndeP+YdMCN1tC7PViwQ9KqszxKGNfbv1Bpr/yxz1GPdy2ZXXj8Hj3gf4FsD0Cn +Mq3I3igsq9xC7PUEZ3D+mAPb7DrOMa77R/Grgsz1RMgO9+4IsM7mIATaaVPzz0zksn4 ZXDA== X-Gm-Message-State: AOAM5310BofXyoew1vzDtNNnJUxETLYLy4jZDVBWecj66mbyWQaBmD3D /kfpy6TDSY9YahQ0jVqWbdcyctz0smeTvcJLCDk1NeGtybHTog== X-Google-Smtp-Source: ABdhPJzJcbO2CAh/v+qzPcQOE6OCiYzVJQL2EHT4lkFlz5/RDo9SPh7GK3Xop/UJ0/Qy9iaKqsi7K1p5EI5ZhYNizf0= X-Received: by 2002:a17:907:7242:: with SMTP id ds2mr2318193ejc.269.1637630520687; Mon, 22 Nov 2021 17:22:00 -0800 (PST) MIME-Version: 1.0 From: David McLaughlin Date: Mon, 22 Nov 2021 18:21:24 -0700 Message-ID: Subject: More Information To: 52049@debbugs.gnu.org Content-Type: multipart/alternative; boundary="00000000000075978505d16a91c5" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 52049 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 (-) --00000000000075978505d16a91c5 Content-Type: text/plain; charset="UTF-8" Sorry. I thought I was on 20.04 Ubuntu, but reading my report of a bug, I was not. Please disregard this, as there is no failure with shred version 8.30. --00000000000075978505d16a91c5 Content-Type: text/html; charset="UTF-8"
Sorry. I thought I was on 20.04 Ubuntu, but reading my report of a bug, I was not.
Please disregard this, as there is no failure with shred version 8.30.
--00000000000075978505d16a91c5-- From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 22 21:13:01 2021 Received: (at 52049-done) by debbugs.gnu.org; 23 Nov 2021 02:13:01 +0000 Received: from localhost ([127.0.0.1]:49490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpLIr-0002GW-Cl for submit@debbugs.gnu.org; Mon, 22 Nov 2021 21:13:01 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:60906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpLIl-0002G9-P0 for 52049-done@debbugs.gnu.org; Mon, 22 Nov 2021 21:13:00 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 62E2C160051; Mon, 22 Nov 2021 18:12:49 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id EUm_EjaEhr_i; Mon, 22 Nov 2021 18:12:48 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6BF61160108; Mon, 22 Nov 2021 18:12:48 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id KLioRLZqL5Zg; Mon, 22 Nov 2021 18:12:48 -0800 (PST) Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 4F1311600BC; Mon, 22 Nov 2021 18:12:48 -0800 (PST) Message-ID: <5e75f1dc-f2fd-abe0-93bb-761017430106@cs.ucla.edu> Date: Mon, 22 Nov 2021 18:12:47 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: bug#52049: More Information Content-Language: en-US To: David McLaughlin References: From: Paul Eggert Organization: UCLA Computer Science Department In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 52049-done Cc: 52049-done@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: -3.4 (---) On 11/22/21 17:21, David McLaughlin wrote: > Please disregard this, as there is no failure with shred version 8.30. Thanks for letting us know; closing the bug report From unknown Fri Jun 20 07:16: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: Tue, 21 Dec 2021 12:24:09 +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 From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 27 20:51:27 2022 Received: (at control) by debbugs.gnu.org; 28 Jan 2022 01:51:27 +0000 Received: from localhost ([127.0.0.1]:57020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDGQB-0005hG-JL for submit@debbugs.gnu.org; Thu, 27 Jan 2022 20:51:27 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:58418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDGQ8-0005gz-PM for control@debbugs.gnu.org; Thu, 27 Jan 2022 20:51:26 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 67AFF160126 for ; Thu, 27 Jan 2022 17:51:18 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 7K314hraWD_J for ; Thu, 27 Jan 2022 17:51:17 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id C7B14160133 for ; Thu, 27 Jan 2022 17:51:17 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id nT2aEvYKyzsD for ; Thu, 27 Jan 2022 17:51:17 -0800 (PST) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id A00B2160126 for ; Thu, 27 Jan 2022 17:51:17 -0800 (PST) Message-ID: Date: Thu, 27 Jan 2022 17:51:17 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: control@debbugs.gnu.org From: Paul Eggert Subject: 52048 and 52049 are duplicates Organization: UCLA Computer Science Department Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) 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: -3.3 (---) unarchive 52049 tags 52049 notabug tags 52048 notabug close 52048 merge 52048 52049 From unknown Fri Jun 20 07:16: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: Fri, 25 Feb 2022 12:24:08 +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