public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: utils: chattr: fix recursive behaviour
Date: Thu, 20 May 2021 20:40:00 +0000 (GMT)	[thread overview]
Message-ID: <20210520204000.72DB7385741D@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=f8eecf22db118347da55c25c4f75890b9902fabc

commit f8eecf22db118347da55c25c4f75890b9902fabc
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Thu May 20 22:32:34 2021 +0200

    Cygwin: utils: chattr: fix recursive behaviour
    
      chattr [mode] dir
    
    incorrectly recurses one level into the given directory, even if the
    --recursive option has not been used.  This patch adds a test to avoid
    this bug.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/utils/chattr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/utils/chattr.c b/winsup/utils/chattr.c
index c7dc649c2..eb60e5d3e 100644
--- a/winsup/utils/chattr.c
+++ b/winsup/utils/chattr.c
@@ -347,7 +347,7 @@ next:
 	{
 	  if (chattr (argv[optind]))
 	    ret = 1;
-	  if (S_ISDIR (st.st_mode) && chattr_dir (argv[optind]))
+	  if (S_ISDIR (st.st_mode) && Ropt && chattr_dir (argv[optind]))
 	    ret = 1;
 	}
     }


                 reply	other threads:[~2021-05-20 20:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210520204000.72DB7385741D@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).