From unknown Sat Jun 21 05:19:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#50784: coreutils 9.0 sometimes gets spurious failures in chmod -R Resent-From: Daniel Schepler Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 24 Sep 2021 18:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50784 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 50784@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163250773432464 (code B ref -1); Fri, 24 Sep 2021 18:23:01 +0000 Received: (at submit) by debbugs.gnu.org; 24 Sep 2021 18:22:14 +0000 Received: from localhost ([127.0.0.1]:59253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTppu-0008RW-I1 for submit@debbugs.gnu.org; Fri, 24 Sep 2021 14:22:14 -0400 Received: from lists.gnu.org ([209.51.188.17]:44318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTppr-0008RK-V6 for submit@debbugs.gnu.org; Fri, 24 Sep 2021 14:22:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTppo-0002nT-Cc for bug-coreutils@gnu.org; Fri, 24 Sep 2021 14:22:10 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:39653) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mTppk-0000EQ-7p for bug-coreutils@gnu.org; Fri, 24 Sep 2021 14:22:05 -0400 Received: by mail-ed1-x52e.google.com with SMTP id x7so24647704edd.6 for ; Fri, 24 Sep 2021 11:21:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=usW/zgQlM6IFCSMhaETy/5CoBqLo1kuublCkA4y3i6U=; b=X8EQBWeXKjPB70cSXI85I+rTeX+xkzUYM5pXeFv00vW8n0OLjqCsbkfnoFDgXhI5Wl sQ//K6JG/gy9hjCYuZoVwbiSkgpaNCmuteIQpi45v8YUriszUVgfg2lNL1wmswtcU2sP lAqvNgvqyAqGPvuJGXmHwMVAzrguxwrMRjlQua/VrrlF255gZPuoG20P8IDaCn/ElyI/ xHCwh+PzXXHMg81hOE8ZTqOJQEewMzdxdYQk4uSBUXAZZzr9xXOBiOo+z268yYy9GAIg TPJaqgvT4moTFwJt8lkyQYiKNY9K2BP8e/HSM4lHwF72xxpWaph56JrAfaJdkjT//t2p +xJQ== 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=usW/zgQlM6IFCSMhaETy/5CoBqLo1kuublCkA4y3i6U=; b=j+qBH7D1SCRp3qHHZnSVtcM5/TFsJ+o24duMLO+2lAxA+b7DbxSBTM7VuqTCqLqmVF 8V7RIsQUDfqXTgIeL6IGwpBptRvTQOnhfXc4V3hU8X51R0ohgAQ6qKbWrGtpcXiKPQ8r nYg8g2qjtyQwVrlrPrUKKjUSFPDDobqwdTnMNpdk7OCmdWE86uLPK0MC7Ojq+tfx3E1M 9KMDzylOEokSB4eksXgfHfaezpGtWsmU1PncZYU3q3IPGNZ9oQQp8SxNn9pIk3Mh1DEY q7CBFVbzY55C0xKlKkJpEqEY2CWqknkj6d1R6oHZE0ACPYya4yrw9IxKK1aUvgWj1X3Q p+kg== X-Gm-Message-State: AOAM5335HNpXgeCWptrV7U5ztD9pnTRFUnYRy3r7qCXZf0nQQabnuywY 7nM4QjivXPbb23M2hHLdk5bvLUJyufg1tNfW5NzAhqBJ X-Google-Smtp-Source: ABdhPJxioWsEDICiHKSFKsWmzRE06FIK4tTLgJjpYG8xd3+izbCM8CXYvz76VLt9Br2xP6VqRwH34u5dQSPJWh6x9Sc= X-Received: by 2002:aa7:c952:: with SMTP id h18mr6742601edt.18.1632507711711; Fri, 24 Sep 2021 11:21:51 -0700 (PDT) MIME-Version: 1.0 From: Daniel Schepler Date: Fri, 24 Sep 2021 11:21:40 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=dschepler@gmail.com; helo=mail-ed1-x52e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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 (--) After I upgraded my system (locally built) to coreutils 9.0, I noticed that my lightly modified sbuild started getting build failures when it tries to run "chmod -R g+w /<>" (as root) in the chroot. I'm not sure exactly what combination of files triggers the error, but I'm able to reproduce it roughly as follows: cd /tmp tar -x -f .../coreutils-9.0.tar.xz cd coreutils-9.0 mkdir obj-x86_64-linux-gnu cd obj-x86_64-linux-gnu ../configure --prefix=/usr make -j8 chmod -R u+w /tmp/coreutils-9.0/obj-x86_64-linux-gnu echo $? In the last chmod command, there are no failures reported; and even if I run it under strace, I see no hints of any failed system calls other than one in access("/etc/ld.so.preload", R_OK) at startup -- and certainly no failures in the fchmodat() system calls. Yet the exit code from the process is 1. I wasn't seeing any such errors under sbuild using coreutils 8.32. -- Daniel Schepler From unknown Sat Jun 21 05:19:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#50784: coreutils 9.0 sometimes gets spurious failures in chmod -R Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 24 Sep 2021 19:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50784 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Daniel Schepler , 50784@debbugs.gnu.org Received: via spool by 50784-submit@debbugs.gnu.org id=B50784.16325117539818 (code B ref 50784); Fri, 24 Sep 2021 19:30:02 +0000 Received: (at 50784) by debbugs.gnu.org; 24 Sep 2021 19:29:13 +0000 Received: from localhost ([127.0.0.1]:59296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTqsi-0002YI-TF for submit@debbugs.gnu.org; Fri, 24 Sep 2021 15:29:13 -0400 Received: from mail-wr1-f54.google.com ([209.85.221.54]:40523) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTqsg-0002Xz-Uv for 50784@debbugs.gnu.org; Fri, 24 Sep 2021 15:29:12 -0400 Received: by mail-wr1-f54.google.com with SMTP id t28so17116147wra.7 for <50784@debbugs.gnu.org>; Fri, 24 Sep 2021 12:29:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=jC3WedIspul+R6LScHmcCPoJ81kGPzAJIII0PegDB30=; b=WQlXYz8K3Ch4zFaPXxNkf5D+rOAgUxXL4D5kvtWGT+SBWB0frgj6x6qwQ8f+AnOSVQ KnKpWy3G9ETpQ3I/g7Uk5nt6e4T0t/jL/qSE2T9DLUr6S/puAqVyAoqMJtIaTXpu2akx /njt/WXlHDDeQvBnAsIB2IJVqDxnNHO+AC4a9IJYQuI9/t+UTARjjHjJVJOScK4c1oTv BKg5WhUlNHR5co60SAywaqT67UqTE+8wPXxsOgh0E463pmOeC4VduJmJuZ5CSS4ylIWt 0Wysl2msPTF+/D8WWssUd/kRdO23I45TDIrml7DRIPVbr8/BGZ9yqs7mIi7Tt11zpjtQ ZSxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jC3WedIspul+R6LScHmcCPoJ81kGPzAJIII0PegDB30=; b=h4lwrNKGQSgFSOH+fhT3VTxv7hkOPXMEoOUrPAuXHvRbfnMxDGN1AgRlMOy/Y7siT2 fMA5ybuX+iDL3R30/HyvoM3rz0uqlMV9udRS0cF5MvbtxqbOeHPFHpb/I8/ionIFLT+2 wgMMQRZwW+5dzvk0N2sA3FEGw66aN8eNQQFDLxeq2WzZo5kab/awAI/E3OO4QEPeh5Pv +TBrtVvoT9w5ut2gska6b32hRVQhfWIRj825wMuOWztvSV4BRaIq8BRSpyYvG7gHf+RS kUism/B5xrzgJ79aqeW09V3AEYDSv8JSO8QC7IlPN5RNtUSINIWat2jVmz64G+WEquTn fXZA== X-Gm-Message-State: AOAM532n8WbYuddEaNVvm0WHRnFjQOuQAP4RdqABKKNSH8l+lnhZ/9Uu T4o3NNoAs000oUceKctwMVUXi6rQ588pqA== X-Google-Smtp-Source: ABdhPJxO5SJntN82TZ2R6ByJRy327iYuCEgSKMmMtpGIzK6s/qKIlyfR9KabKDC/50FWY3InHGr2JQ== X-Received: by 2002:a1c:a552:: with SMTP id o79mr3793381wme.170.1632511744821; Fri, 24 Sep 2021 12:29:04 -0700 (PDT) Received: from localhost.localdomain (86-44-211-219-dynamic.agg2.lod.rsl-rtd.eircom.net. [86.44.211.219]) by smtp.googlemail.com with UTF8SMTPSA id t23sm9362589wrb.71.2021.09.24.12.29.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Sep 2021 12:29:04 -0700 (PDT) References: From: =?UTF-8?Q?P=C3=A1draig?= Brady Message-ID: <5523ad76-bd58-be6d-33bd-ef0dd996cc81@draigBrady.com> Date: Fri, 24 Sep 2021 20:29:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Thunderbird/84.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.4 (/) 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.6 (/) On 24/09/2021 19:21, Daniel Schepler wrote: > After I upgraded my system (locally built) to coreutils 9.0, I noticed > that my lightly modified sbuild started getting build failures when it > tries to run "chmod -R g+w /<>" (as root) in the chroot. > I'm not sure exactly what combination of files triggers the error, but > I'm able to reproduce it roughly as follows: > > cd /tmp > tar -x -f .../coreutils-9.0.tar.xz > cd coreutils-9.0 > mkdir obj-x86_64-linux-gnu > cd obj-x86_64-linux-gnu > ../configure --prefix=/usr > make -j8 > chmod -R u+w /tmp/coreutils-9.0/obj-x86_64-linux-gnu > echo $? > > In the last chmod command, there are no failures reported; and even if > I run it under strace, I see no hints of any failed system calls other > than one in access("/etc/ld.so.preload", R_OK) at startup -- and > certainly no failures in the fchmodat() system calls. Yet the exit > code from the process is 1. > > I wasn't seeing any such errors under sbuild using coreutils 8.32. Drats. I think it's determining ignoring symlinks as an error. Could you try with the following untested diff: diff --git a/src/chmod.c b/src/chmod.c index 37b04f500..9ab60898d 100644 --- a/src/chmod.c +++ b/src/chmod.c @@ -322,6 +322,9 @@ process_file (FTS *fts, FTSENT *ent) if ( ! recurse) fts_set (fts, ent, FTS_SKIP); + if (ch.status == CH_NOT_APPLIED) /* For symlinks. */ + ch.status = CH_NO_CHANGE_REQUESTED; + return CH_NO_CHANGE_REQUESTED <= ch.status; } From unknown Sat Jun 21 05:19:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#50784: coreutils 9.0 sometimes gets spurious failures in chmod -R Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 24 Sep 2021 20:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50784 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Daniel Schepler , 50784@debbugs.gnu.org Received: via spool by 50784-submit@debbugs.gnu.org id=B50784.163251380115028 (code B ref 50784); Fri, 24 Sep 2021 20:04:01 +0000 Received: (at 50784) by debbugs.gnu.org; 24 Sep 2021 20:03:21 +0000 Received: from localhost ([127.0.0.1]:59311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTrPX-0003u0-1m for submit@debbugs.gnu.org; Fri, 24 Sep 2021 16:03:20 -0400 Received: from mail-wr1-f41.google.com ([209.85.221.41]:36516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTrPU-0003tS-Mp for 50784@debbugs.gnu.org; Fri, 24 Sep 2021 16:03:05 -0400 Received: by mail-wr1-f41.google.com with SMTP id g16so30772012wrb.3 for <50784@debbugs.gnu.org>; Fri, 24 Sep 2021 13:03:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:from:to:references:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=RvzE0B5sn1t3uPpzWX8PEdJm6VloZHi4UNBmioxm2gE=; b=oaDJLfTFPhWG3KHZTMyLumwa7GDtBGEiyhlpIzM0oocZ9Uf61PaC8+DO50zmn0fukC j9Tb60sYyWWd6YQY9xMVXfSYhTeYdI7qTgaojFI6R3KjyIlEP1nHER4qr/LJHlBDucHP MSevU77PCdJc3JlR1J2WQ+ytEifFGSyrNa3OSFcpFTLcTY+9FoxjrhR2cbBr6zUlPo4+ THSLzXiWpWTlFy06drdrRW4jpv5P42Pn7UMD2yE3cpa4FAqCH3NPmdNLTlqB23jznI0R Bd/XLYhKqQAvkNKc6oleGP7fSAvalHk939bhQUmDDFPyPM9GB4xXcth17o7N9+8o92Rl Helg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:subject:from:to:references:message-id :date:user-agent:mime-version:in-reply-to:content-language; bh=RvzE0B5sn1t3uPpzWX8PEdJm6VloZHi4UNBmioxm2gE=; b=7nN8zFBG+j2Pny60z1efo939fkxJAYXaN3GlEBFF815u47uN3tssvdfUtrZx+I7xhm yORgiVIRK6TQEfvFtA3lsRLEADXzJ7os1GJkSuwkMrF05LhY4jBDDXkCfwvOV4BhoL2q Qohf/8k0ohQvLUB6pYZG2TyIejxbqu62gKpDvftFISXR/1OBQxalXaJ1ZJ2goc9vFxIs QAM3dCEBs8094cKBrH+rMjJ8K807HFYh0aLIhRfyDqomLWdYbwhhwavwz6vb21elpZ0V KMbp3aYQanzppa7uvu2JXHjRRyz95v2zgv792p7RV4flYJg9no8l/KQBt6LadslAAa/M Cr7A== X-Gm-Message-State: AOAM532L0zVR7U+ZsUX8WNh92OJZofLLw0DrORzmcu6VVd0R3XkuTkKH N5ODSg5COq72Ci2GPCsKQBjW5izaOyISLQ== X-Google-Smtp-Source: ABdhPJzKdAf9LNLSr6e+D5kfllzybfFVXT6nfjMiKPxWagWiwZ5NfdA3QaHSlcMQfOCBe1p6WT9a4Q== X-Received: by 2002:a5d:5042:: with SMTP id h2mr13267180wrt.57.1632513778430; Fri, 24 Sep 2021 13:02:58 -0700 (PDT) Received: from localhost.localdomain (86-44-211-219-dynamic.agg2.lod.rsl-rtd.eircom.net. [86.44.211.219]) by smtp.googlemail.com with UTF8SMTPSA id g1sm16110635wmk.2.2021.09.24.13.02.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Sep 2021 13:02:57 -0700 (PDT) From: =?UTF-8?Q?P=C3=A1draig?= Brady References: <5523ad76-bd58-be6d-33bd-ef0dd996cc81@draigBrady.com> Message-ID: <241a11c7-2825-ca4d-8546-f4aa99629341@draigBrady.com> Date: Fri, 24 Sep 2021 21:02:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Thunderbird/84.0 MIME-Version: 1.0 In-Reply-To: <5523ad76-bd58-be6d-33bd-ef0dd996cc81@draigBrady.com> Content-Type: multipart/mixed; boundary="------------3BD3FB06EC6AC7693B6C67F8" Content-Language: en-US X-Spam-Score: 0.4 (/) 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.6 (/) This is a multi-part message in MIME format. --------------3BD3FB06EC6AC7693B6C67F8 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 24/09/2021 20:29, Pádraig Brady wrote: > On 24/09/2021 19:21, Daniel Schepler wrote: >> After I upgraded my system (locally built) to coreutils 9.0, I noticed >> that my lightly modified sbuild started getting build failures when it >> tries to run "chmod -R g+w /<>" (as root) in the chroot. >> I'm not sure exactly what combination of files triggers the error, but >> I'm able to reproduce it roughly as follows: >> >> cd /tmp >> tar -x -f .../coreutils-9.0.tar.xz >> cd coreutils-9.0 >> mkdir obj-x86_64-linux-gnu >> cd obj-x86_64-linux-gnu >> ../configure --prefix=/usr >> make -j8 >> chmod -R u+w /tmp/coreutils-9.0/obj-x86_64-linux-gnu >> echo $? >> >> In the last chmod command, there are no failures reported; and even if >> I run it under strace, I see no hints of any failed system calls other >> than one in access("/etc/ld.so.preload", R_OK) at startup -- and >> certainly no failures in the fchmodat() system calls. Yet the exit >> code from the process is 1. >> >> I wasn't seeing any such errors under sbuild using coreutils 8.32. > > Drats. I think it's determining ignoring symlinks as an error. > Could you try with the following untested diff: > > diff --git a/src/chmod.c b/src/chmod.c > index 37b04f500..9ab60898d 100644 > --- a/src/chmod.c > +++ b/src/chmod.c > @@ -322,6 +322,9 @@ process_file (FTS *fts, FTSENT *ent) > if ( ! recurse) > fts_set (fts, ent, FTS_SKIP); > > + if (ch.status == CH_NOT_APPLIED) /* For symlinks. */ > + ch.status = CH_NO_CHANGE_REQUESTED; > + > return CH_NO_CHANGE_REQUESTED <= ch.status; > } Tested equivalent patch is attached. --------------3BD3FB06EC6AC7693B6C67F8 Content-Type: text/x-patch; charset=UTF-8; name="chmod-fix-symlink-exit.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="chmod-fix-symlink-exit.patch" >From 4342a8d24f4eaafbeb9f918973bf531517179e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Fri, 24 Sep 2021 20:57:41 +0100 Subject: [PATCH] chmod: fix exit status when ignoring symlinks * src/chmod.c: Reorder enum so CH_NOT_APPLIED can be treated as a non error. * tests/chmod/ignore-symlink.sh: A new test. * tests/local.mk: Reference the new test. Fixes https://bugs.gnu.org/50784 --- src/chmod.c | 4 ++-- tests/chmod/ignore-symlink.sh | 31 +++++++++++++++++++++++++++++++ tests/local.mk | 1 + 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100755 tests/chmod/ignore-symlink.sh diff --git a/src/chmod.c b/src/chmod.c index 37b04f500..57ac47f33 100644 --- a/src/chmod.c +++ b/src/chmod.c @@ -44,8 +44,8 @@ struct change_status enum { CH_NO_STAT, - CH_NOT_APPLIED, CH_FAILED, + CH_NOT_APPLIED, CH_NO_CHANGE_REQUESTED, CH_SUCCEEDED } @@ -322,7 +322,7 @@ process_file (FTS *fts, FTSENT *ent) if ( ! recurse) fts_set (fts, ent, FTS_SKIP); - return CH_NO_CHANGE_REQUESTED <= ch.status; + return CH_NOT_APPLIED <= ch.status; } /* Recursively change the modes of the specified FILES (the last entry diff --git a/tests/chmod/ignore-symlink.sh b/tests/chmod/ignore-symlink.sh new file mode 100755 index 000000000..5ce3de816 --- /dev/null +++ b/tests/chmod/ignore-symlink.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# Test for proper exit code of chmod on a processed symlink. + +# Copyright (C) 2021 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src +print_ver_ chmod + +mkdir dir || framework_failure_ +touch dir/f || framework_failure_ +ln -s f dir/l || framework_failure_ + +# This operation ignores symlinks but should succeed. +chmod u+w -R dir 2> out || fail=1 + +compare /dev/null out || fail=1 + +Exit $fail diff --git a/tests/local.mk b/tests/local.mk index 228d0e368..b5b893fb7 100644 --- a/tests/local.mk +++ b/tests/local.mk @@ -456,6 +456,7 @@ all_tests = \ tests/chmod/c-option.sh \ tests/chmod/equal-x.sh \ tests/chmod/equals.sh \ + tests/chmod/ignore-symlink.sh \ tests/chmod/inaccessible.sh \ tests/chmod/octal.sh \ tests/chmod/setgid.sh \ -- 2.26.2 --------------3BD3FB06EC6AC7693B6C67F8-- From unknown Sat Jun 21 05:19:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#50784: coreutils 9.0 sometimes gets spurious failures in chmod -R Resent-From: Daniel Schepler Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 24 Sep 2021 21:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50784 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: =?UTF-8?Q?P=C3=A1draig?= Brady Cc: 50784@debbugs.gnu.org Received: via spool by 50784-submit@debbugs.gnu.org id=B50784.163251979026618 (code B ref 50784); Fri, 24 Sep 2021 21:44:02 +0000 Received: (at 50784) by debbugs.gnu.org; 24 Sep 2021 21:43:10 +0000 Received: from localhost ([127.0.0.1]:59364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTsyM-0006vG-E6 for submit@debbugs.gnu.org; Fri, 24 Sep 2021 17:43:10 -0400 Received: from mail-ed1-f49.google.com ([209.85.208.49]:34750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTsyJ-0006uw-Vw for 50784@debbugs.gnu.org; Fri, 24 Sep 2021 17:43:09 -0400 Received: by mail-ed1-f49.google.com with SMTP id eg28so41471997edb.1 for <50784@debbugs.gnu.org>; Fri, 24 Sep 2021 14:43:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=04bvkw4XGA4Qf3LA2oj8iz1iDwN+Ced6lRUegrxSkks=; b=BFXgGlA/2JNrkZcleoRtYKIGE2VEL375cNxiyfbfakjW6XfsbNArey8k6J6YZoLfm5 d1s3tRAurnGrniOueEUcNzn1+mQ66Z4vXF9YlVNOmjd6IG45L3ESrqvHJJ14NxFTTfYd b67yO5+unlup/sCRNg4IKU0RqZXfP+/f18Tc9y4SqEFtbVbf7TlkF3+vrYrOh8DzQe/W ZLXJPX5hJoi7eTc7wBAqvbbZxHor7Hsb/5xaErp/ADUsuLpeMR6dTbadxNH6MWTJ5Jnn r4/zL9a6+Vu/eL5IAd7w8qWuvasSOnOn/l8jzVMTNXRMLIwsOKvPozhl99KXmJ9b9Isp B0JA== 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:cc:content-transfer-encoding; bh=04bvkw4XGA4Qf3LA2oj8iz1iDwN+Ced6lRUegrxSkks=; b=fmHxmPIq/VhsiMtRuK1FYFD5XYvu0CqRH5K/U07TU/PaKDlGlHL3eTLV+i59nqLTEg yKUGWQiffKhvo4JHPZ18crg+35sC1vkXUH/O1iTCaHn8wrHZkcBYSRcoG6uAMrWUp7Gx /v7uZwsouIM4s03n0RoqqXLt5An8sVNWJFhlEhuOf/UypLRMDKJsR7whVgP9tDHOVBvA vzBtkMIHgA5qgwuBao6wZJ91lQiHucSocGSQ5zfXW7mDfUEDHBF17ZTQtCnQyDW3RaKU Yhd+dwwpMm1eAns+3YgWohropMj+D4jM4ptwExiocJLdqsIh2hlglp1r7rd00p5WWTPb J0jQ== X-Gm-Message-State: AOAM5324vRfnfoYeDDMyuNgNHfbloDzggF/SXo2hg6wUkw8Ep8EXyjOZ Tp/B+DVxGK1d6DwiKKNoEgeYvEDR9FFRLIrR9pU= X-Google-Smtp-Source: ABdhPJwrb1Mm2W2jIfG3S+QlAt5u7zvHVaJi9zqptjL/sPSGnTPSHpNf/6+bfb4oSHcXB80f9tJWIoeOzeP2Jw75t84= X-Received: by 2002:a50:e08a:: with SMTP id f10mr7833414edl.319.1632519782078; Fri, 24 Sep 2021 14:43:02 -0700 (PDT) MIME-Version: 1.0 References: <5523ad76-bd58-be6d-33bd-ef0dd996cc81@draigBrady.com> <241a11c7-2825-ca4d-8546-f4aa99629341@draigBrady.com> In-Reply-To: <241a11c7-2825-ca4d-8546-f4aa99629341@draigBrady.com> From: Daniel Schepler Date: Fri, 24 Sep 2021 14:42:51 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) 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 (-) On Fri, Sep 24, 2021 at 1:02 PM P=C3=A1draig Brady wrote= : > > Could you try with the following untested diff: > > Tested equivalent patch is attached. Yes, with chmod-fix-symlink-exit.patch applied and the resulting packages installed for testing, the issue does appear to be resolved. --=20 Daniel Schepler From unknown Sat Jun 21 05:19:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#50784: coreutils 9.0 sometimes gets spurious failures in chmod -R Resent-From: Bernhard Voelker Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 24 Sep 2021 22:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50784 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: =?UTF-8?Q?P=C3=A1draig?= Brady , Daniel Schepler , 50784@debbugs.gnu.org Received: via spool by 50784-submit@debbugs.gnu.org id=B50784.163252306417331 (code B ref 50784); Fri, 24 Sep 2021 22:38:02 +0000 Received: (at 50784) by debbugs.gnu.org; 24 Sep 2021 22:37:44 +0000 Received: from localhost ([127.0.0.1]:59408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTtp9-0004VR-M7 for submit@debbugs.gnu.org; Fri, 24 Sep 2021 18:37:43 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:33601) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTtp6-0004V8-DS for 50784@debbugs.gnu.org; Fri, 24 Sep 2021 18:37:42 -0400 Received: from [10.0.2.16] ([51.37.167.197]) by mrelayeu.kundenserver.de (mreue011 [213.165.67.97]) with ESMTPSA (Nemesis) id 1Ma1oK-1mOLvM3Cce-00W0kR; Sat, 25 Sep 2021 00:37:32 +0200 Message-ID: Date: Sat, 25 Sep 2021 00:37:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Content-Language: en-US References: <5523ad76-bd58-be6d-33bd-ef0dd996cc81@draigBrady.com> <241a11c7-2825-ca4d-8546-f4aa99629341@draigBrady.com> From: Bernhard Voelker In-Reply-To: <241a11c7-2825-ca4d-8546-f4aa99629341@draigBrady.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:lwZwdkiLAodQRZnsQcvxTENlBt2ns0ZHOvtvCr0MN5W4dTmA81m 44JQuIFygoqAjhxy1yO32GUtUBTNxrxRr2rJ/30Ng6GV27fgJqF8St0dIUAuNpqhFkB+q2s onumY4CAjK6L+tUzeF5p7yliv/PamEnXHq3rSLlD3urv4ONgKTJp5Npkxj7qeDKFLVr+22M abZGjJ0VW7YdunGdwdTXA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Y4+PNCYz+H8=:ta+fS2jIuQMMwq1yOdqhDG 1Pk0GHErR5LV+RueLAy2C/bd8EBYnLmq7m/DaN2F74uslAq6kHtB2pNMiVNLVIDXrrXtNwS+D R69m38GRnezewBjZAqDxMTiqq4ujyqT8PeXFuv94cwYMjpftpY4ur3LxwCfjU85ZzkP70491u 0thtiGha+DqJJTqxWd9p9OcAUhHzA6JE6gN4uhi/omOERywZ8ozW2MzQVps8ZfFQRCn2MpC86 qsgr9rcAA5PnXOBoUbhjIIPsqDdNEacM/ths/5/5slmtxaUUa1i0IZwupER6t7RBu20648L1t 0XacZpe9aj0h8DIrCFXXtsrxlayFlXnjcBGHAxj8qk8dR6gGwsn2sphmC15BES51U8lvGZmqm n0+t1FVDZxGiwLpAux7u9YdX1/eSQxH2snSujyvtWA+DUCLqwWjtb1qPzgBeBrYNCXVhWKWTT +lExuomVTntFAQXLBJ5CBGJC4dtc9kw+QqE5LoS5dtRz9znh4uNiwHd2ks9jXRtN4c1AwhTbg mfh4xqSAvJdx1vf11tAvbrGVGNK6MCgFgPNwHYEftQLIv3+SwEk/4OlZHzd65LwZ6QDbfebZG +6mXleksGD4pMhulSTC+TlQFNmdNxxO2HybQqtGpjroFYzGhq26GOH9UgAE+Fmx9Mq+Xvdvyw nI/2mJGaBuEpEZoF1mtzjR0TGWGWgaY34l0G9FbdhYC9AZQGLu/5AC1GKFkR0wXylH+dGVYPg djrnK2ZsH9lHOa3TRBA5bHjJNAxUYZSdyygpHJ8LTk5X1rp5Sflq4ulZ4xI= X-Spam-Score: -0.1 (/) 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.1 (-) On 9/24/21 22:02, Pádraig Brady wrote: > Tested equivalent patch is attached. Nice small patch. Maybe it's worth documenting in the enum where the "bad range" starts against which the code later tests? Furthermore, I think it's worth adding a NEWS entry and mentioning that this bug has been introduced in v9.0, namely in v8.32-193-gbbb19b186. Thanks & have a nice day, Berny From unknown Sat Jun 21 05:19:26 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Daniel Schepler Subject: bug#50784: closed (Re: bug#50784: coreutils 9.0 sometimes gets spurious failures in chmod -R) Message-ID: References: <07a23500-3f15-daf2-1244-a472634b377b@draigBrady.com> X-Gnu-PR-Message: they-closed 50784 X-Gnu-PR-Package: coreutils Reply-To: 50784@debbugs.gnu.org Date: Fri, 24 Sep 2021 22:49:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1632523741-18844-1" This is a multi-part message in MIME format... ------------=_1632523741-18844-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #50784: coreutils 9.0 sometimes gets spurious failures in chmod -R which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 50784@debbugs.gnu.org. --=20 50784: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D50784 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1632523741-18844-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 50784-done) by debbugs.gnu.org; 24 Sep 2021 22:48:55 +0000 Received: from localhost ([127.0.0.1]:59443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTtzz-0004td-Bt for submit@debbugs.gnu.org; Fri, 24 Sep 2021 18:48:55 -0400 Received: from mail-wr1-f48.google.com ([209.85.221.48]:46860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTtzv-0004tJ-5Y for 50784-done@debbugs.gnu.org; Fri, 24 Sep 2021 18:48:53 -0400 Received: by mail-wr1-f48.google.com with SMTP id c21so2074089wrb.13 for <50784-done@debbugs.gnu.org>; Fri, 24 Sep 2021 15:48:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=B8tFHKetgqZUCGXZQEArgxpA4KVKQ2XxAkjbsz3nqZY=; b=Gs56R1S/tfgbKIPMIXBOXfz52kXy5kif3E8JEVkszQZN3iLFTmDHdX4NcI4vwT+NxQ mZ8GQL6q4CUQpy0Iy1o563padLPFSW5rOZZDICsEmZtcVv7tzeuN8EDcFWMLyB9fdWpb 7WcH0fwvpDDM9pCdRYQiEJ/4QsuZJwsFafBtiZuuIcXI37mTK+WE+imxP/gfSD2/Y1yC dz29tuBYTshkDYX7q4Ldc5yU5BSrTJQEI3XcMF59it9xiHyw/EDx1FlgiU7cMXOws0vK RwhOE+w/HEKrz+ra9U22o6sfpCK77oQDVQwp9iPNt3Lgv+96MsEnm+x0jPPPIgB+Hb3N lx5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=B8tFHKetgqZUCGXZQEArgxpA4KVKQ2XxAkjbsz3nqZY=; b=0DajBKAJAsahfHoijfaV3xpRvWPPUlrYlWe9d2ESTKVdayxrRHvqOTBdjNNZTV1tMO zqKDz2cgNKPMo+5t0q2JsmgggiBBaD4OYTby/O0ViGUQkK53J21gInoflU/7JQKuxgjX j+tmyrV2GPbqt9zt5d0sZ+cTKi7myxVKq9ckRdaAnFeK5EohYvpzPeq9Gti67huWOESN oSz+t3YytRkqxgSn1wqES56K+4f+1X+AqoBK4Nh9KX1xJaK6k2yVkq6rd5di10MYgAZ1 yFzt1QbfDlm4yDJGeUXORyaPOLum8qHH5W0oKui8tRUPr7JOAeNbUIFfnIVleZ+IXNvo BTuA== X-Gm-Message-State: AOAM532E4p5zuh9ER6GLwVMZbw7TOXohgMYoMhhDxKsMISM3EU6Aw/f0 Dom5UZdIGjEMBux+eIjlBQNOFiWNvm0eCw== X-Google-Smtp-Source: ABdhPJwwS4RZUrWUMmyYfh1LS0F+Y7791WzcQYz8LfqfZMFfGHgirx6JBINdthTbEvGFHTZZfd4Bcw== X-Received: by 2002:a1c:ed13:: with SMTP id l19mr4367188wmh.48.1632523724965; Fri, 24 Sep 2021 15:48:44 -0700 (PDT) Received: from localhost.localdomain (86-44-211-219-dynamic.agg2.lod.rsl-rtd.eircom.net. [86.44.211.219]) by smtp.googlemail.com with UTF8SMTPSA id z6sm10779848wmp.1.2021.09.24.15.48.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Sep 2021 15:48:44 -0700 (PDT) Subject: Re: bug#50784: coreutils 9.0 sometimes gets spurious failures in chmod -R To: Daniel Schepler References: <5523ad76-bd58-be6d-33bd-ef0dd996cc81@draigBrady.com> <241a11c7-2825-ca4d-8546-f4aa99629341@draigBrady.com> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <07a23500-3f15-daf2-1244-a472634b377b@draigBrady.com> Date: Fri, 24 Sep 2021 23:48:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Thunderbird/84.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: 50784-done Cc: 50784-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: -0.6 (/) On 24/09/2021 22:42, Daniel Schepler wrote: > On Fri, Sep 24, 2021 at 1:02 PM Pádraig Brady wrote: >>> Could you try with the following untested diff: >> >> Tested equivalent patch is attached. > > Yes, with chmod-fix-symlink-exit.patch applied and the resulting > packages installed for testing, the issue does appear to be resolved. Thanks for testing. Pushed (with NEWS update). marking this as done. thanks, Pádraig ------------=_1632523741-18844-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 24 Sep 2021 18:22:14 +0000 Received: from localhost ([127.0.0.1]:59253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTppu-0008RW-I1 for submit@debbugs.gnu.org; Fri, 24 Sep 2021 14:22:14 -0400 Received: from lists.gnu.org ([209.51.188.17]:44318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTppr-0008RK-V6 for submit@debbugs.gnu.org; Fri, 24 Sep 2021 14:22:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTppo-0002nT-Cc for bug-coreutils@gnu.org; Fri, 24 Sep 2021 14:22:10 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:39653) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mTppk-0000EQ-7p for bug-coreutils@gnu.org; Fri, 24 Sep 2021 14:22:05 -0400 Received: by mail-ed1-x52e.google.com with SMTP id x7so24647704edd.6 for ; Fri, 24 Sep 2021 11:21:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=usW/zgQlM6IFCSMhaETy/5CoBqLo1kuublCkA4y3i6U=; b=X8EQBWeXKjPB70cSXI85I+rTeX+xkzUYM5pXeFv00vW8n0OLjqCsbkfnoFDgXhI5Wl sQ//K6JG/gy9hjCYuZoVwbiSkgpaNCmuteIQpi45v8YUriszUVgfg2lNL1wmswtcU2sP lAqvNgvqyAqGPvuJGXmHwMVAzrguxwrMRjlQua/VrrlF255gZPuoG20P8IDaCn/ElyI/ xHCwh+PzXXHMg81hOE8ZTqOJQEewMzdxdYQk4uSBUXAZZzr9xXOBiOo+z268yYy9GAIg TPJaqgvT4moTFwJt8lkyQYiKNY9K2BP8e/HSM4lHwF72xxpWaph56JrAfaJdkjT//t2p +xJQ== 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=usW/zgQlM6IFCSMhaETy/5CoBqLo1kuublCkA4y3i6U=; b=j+qBH7D1SCRp3qHHZnSVtcM5/TFsJ+o24duMLO+2lAxA+b7DbxSBTM7VuqTCqLqmVF 8V7RIsQUDfqXTgIeL6IGwpBptRvTQOnhfXc4V3hU8X51R0ohgAQ6qKbWrGtpcXiKPQ8r nYg8g2qjtyQwVrlrPrUKKjUSFPDDobqwdTnMNpdk7OCmdWE86uLPK0MC7Ojq+tfx3E1M 9KMDzylOEokSB4eksXgfHfaezpGtWsmU1PncZYU3q3IPGNZ9oQQp8SxNn9pIk3Mh1DEY q7CBFVbzY55C0xKlKkJpEqEY2CWqknkj6d1R6oHZE0ACPYya4yrw9IxKK1aUvgWj1X3Q p+kg== X-Gm-Message-State: AOAM5335HNpXgeCWptrV7U5ztD9pnTRFUnYRy3r7qCXZf0nQQabnuywY 7nM4QjivXPbb23M2hHLdk5bvLUJyufg1tNfW5NzAhqBJ X-Google-Smtp-Source: ABdhPJxioWsEDICiHKSFKsWmzRE06FIK4tTLgJjpYG8xd3+izbCM8CXYvz76VLt9Br2xP6VqRwH34u5dQSPJWh6x9Sc= X-Received: by 2002:aa7:c952:: with SMTP id h18mr6742601edt.18.1632507711711; Fri, 24 Sep 2021 11:21:51 -0700 (PDT) MIME-Version: 1.0 From: Daniel Schepler Date: Fri, 24 Sep 2021 11:21:40 -0700 Message-ID: Subject: coreutils 9.0 sometimes gets spurious failures in chmod -R To: bug-coreutils@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=dschepler@gmail.com; helo=mail-ed1-x52e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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: -2.3 (--) After I upgraded my system (locally built) to coreutils 9.0, I noticed that my lightly modified sbuild started getting build failures when it tries to run "chmod -R g+w /<>" (as root) in the chroot. I'm not sure exactly what combination of files triggers the error, but I'm able to reproduce it roughly as follows: cd /tmp tar -x -f .../coreutils-9.0.tar.xz cd coreutils-9.0 mkdir obj-x86_64-linux-gnu cd obj-x86_64-linux-gnu ../configure --prefix=/usr make -j8 chmod -R u+w /tmp/coreutils-9.0/obj-x86_64-linux-gnu echo $? In the last chmod command, there are no failures reported; and even if I run it under strace, I see no hints of any failed system calls other than one in access("/etc/ld.so.preload", R_OK) at startup -- and certainly no failures in the fchmodat() system calls. Yet the exit code from the process is 1. I wasn't seeing any such errors under sbuild using coreutils 8.32. -- Daniel Schepler ------------=_1632523741-18844-1-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 24 18:50:55 2021 Received: (at control) by debbugs.gnu.org; 24 Sep 2021 22:50:55 +0000 Received: from localhost ([127.0.0.1]:59455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTu1v-0004yG-0l for submit@debbugs.gnu.org; Fri, 24 Sep 2021 18:50:55 -0400 Received: from mail-wr1-f45.google.com ([209.85.221.45]:34584) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTu1t-0004xw-Bb; Fri, 24 Sep 2021 18:50:53 -0400 Received: by mail-wr1-f45.google.com with SMTP id t8so31908138wri.1; Fri, 24 Sep 2021 15:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=vrmKrZYDq7h8ahH+NhTunrtuYaFKDK1g+Y6PGH5emic=; b=Ja7gL1onibyrn7RiRNp0z2SMjIfYKcZHme6KmLIiDeJF21HP4RAEMY/8q7JgxkwsWw xCja9jL9M6SfleZ5h9rtu9QX7dIIAHU8QD/NXxe9nQunFjNdEhNoM08N3EtCE5eQcstZ 4oiXffAzBVDFDH3xFeUwmKkw6G3VgvXmDjQbIty7bWqtODKXitzjcQe/24cOEYEydmej Sg6nOMhwWe3LrmIy8Ap3bpFTB28xjTZ82hKIKDzUwxxES7eA4ZimQKsSI5lKPOG8WRkl xVtTkPOpeF5fejwGCvac6VTrcyj7AeBQYr7+qPPyFgf2iHzRH/C7/jJWLBbaY6ruywlD UUtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=vrmKrZYDq7h8ahH+NhTunrtuYaFKDK1g+Y6PGH5emic=; b=e1eFNOC1bzZRL76FVuHmpNJ55KImv5M8H+BU7MhRqVy9YDiVRKBCRUD1cxeAHxUvMU aIjQ616LSC7n+wjezo+hlWRbdANNlAqU6ftrgddIds1xI8UXASFnEV1bQn+9NhQwLYna gSBHKClxPzdfJM1Ri1kE593A70x4BUfw7iDM6CkFJhuqbBRSe6E1a+rTblPg23oZhcj6 EKudOuj/1asytSrRnfUF6RgHU0X0Z4BzgCwAsdd1cepCg2tTq7XFDPyDXTcBjx6GMTLK f5seqYA4KNEv+w++w8r5TZsKNBT76WuyRMymLN7rA7cdXhUqW2rjDDGfQwc23jk5kYg0 VYqg== X-Gm-Message-State: AOAM5301iPsu9J1jOf9c+oV4jiHUknEaQL1YBwVakqmfYQvjswBmPQLh gTtGmw/kV4ch/tOYoM3fq4fp196OpZL4H95+ X-Google-Smtp-Source: ABdhPJybWoyVwoDAViR2FH5z87Jp7E8NVVPVd5BP+uBqYMS1AVPwpX7+nPYfwANvWngb2iiUwzb5oQ== X-Received: by 2002:a05:6000:162f:: with SMTP id v15mr14412799wrb.118.1632523847251; Fri, 24 Sep 2021 15:50:47 -0700 (PDT) Received: from localhost.localdomain (86-44-211-219-dynamic.agg2.lod.rsl-rtd.eircom.net. [86.44.211.219]) by smtp.googlemail.com with UTF8SMTPSA id d5sm9671057wra.38.2021.09.24.15.50.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Sep 2021 15:50:46 -0700 (PDT) Subject: Re: bug#50791: Recursive chmod exit status in coreutils-9.0 To: Chris Webb , 50791@debbugs.gnu.org References: <20210924211616.GA6822@arachsys.com> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: Date: Fri, 24 Sep 2021 23:50:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Thunderbird/84.0 MIME-Version: 1.0 In-Reply-To: <20210924211616.GA6822@arachsys.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: 0.4 (/) 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: -0.6 (/) forcemerge 50791 50784 stop On 24/09/2021 22:16, Chris Webb wrote: > Since bbb19b, chmod has started returning EXIT_FAILURE after skipping a > symlink during a recursive change. This affects chmod in the newly released > coreutils-9.0 vs the previous coreutils-8.32 and older versions: > > # mkdir t > # cd t > # : > foo > # ln -s foo bar > > # chmod-8.32 -v -R u+r . ; echo "Exit status $?" > mode of '.' retained as 0755 (rwxr-xr-x) > neither symbolic link './bar' nor referent has been changed > mode of './foo' retained as 0644 (rw-r--r--) > Exit status 0 > > # chmod-9.0 -v -R u+r . ; echo "Exit status $?" > mode of '.' retained as 0755 (rwxr-xr-x) > neither symbolic link './bar' nor referent has been changed > mode of './foo' retained as 0644 (rw-r--r--) > Exit status 1 > > The non-zero exit code is accompanied by no error message or diagnostic. > > Success from process_file() in src/chmod.c is detected by > > ch.status >= CH_NO_CHANGE_REQUESTED > > and the ordering for the possible outcomes in bbb19b puts CH_NOT_APPLIED in > the failure range. However, we finish with CH_NOT_APPLIED if and only if a > symlink has been (correctly) skipped. > > I believe the simple reordering: > > diff --git a/src/chmod.c b/src/chmod.c > index 37b04f500..36894854f 100644 > --- a/src/chmod.c > +++ b/src/chmod.c > @@ -44,9 +44,9 @@ struct change_status > enum > { > CH_NO_STAT, > - CH_NOT_APPLIED, > CH_FAILED, > CH_NO_CHANGE_REQUESTED, > + CH_NOT_APPLIED, > CH_SUCCEEDED > } > status; > > is sufficient to fix with no other side-effects. Thanks for the analysis and patch. I've already pushed a very similar patch at: https://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=e8b56ebd5 sorry for the trouble, Pádraig From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 14 20:10:59 2022 Received: (at control) by debbugs.gnu.org; 15 Jan 2022 01:10:59 +0000 Received: from localhost ([127.0.0.1]:38604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n8Xat-00062k-ID for submit@debbugs.gnu.org; Fri, 14 Jan 2022 20:10:59 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:55942) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n8Xas-00062Y-G1 for control@debbugs.gnu.org; Fri, 14 Jan 2022 20:10:58 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 3982416016A for ; Fri, 14 Jan 2022 17:10:53 -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 lZdwJaOrRNI9 for ; Fri, 14 Jan 2022 17:10:52 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 92DAE16016B for ; Fri, 14 Jan 2022 17:10:52 -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 khlVej2jp7p2 for ; Fri, 14 Jan 2022 17:10:52 -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 7062C16016A for ; Fri, 14 Jan 2022 17:10:52 -0800 (PST) Message-ID: Date: Fri, 14 Jan 2022 17:10:52 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Content-Language: en-US To: control@debbugs.gnu.org From: Paul Eggert Subject: 50784 and 53262 are duplicates and the bug is fixed 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 (---) merge 50784 53262 close 50784