public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: utils: chattr: fix recursive behaviour
@ 2021-05-20 20:40 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2021-05-20 20:40 UTC (permalink / raw)
  To: cygwin-cvs

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;
 	}
     }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-20 20:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20 20:40 [newlib-cygwin] Cygwin: utils: chattr: fix recursive behaviour Corinna Vinschen

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).