Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-envelope-info: Message-Id: <5.2.1.1.2.20030509151744.063bfb20@pop.sonic.net> X-Sender: rschulz AT pop DOT sonic DOT net Date: Fri, 09 May 2003 15:27:03 -0700 To: cygwin AT cygwin DOT com From: Randall R Schulz Subject: RE: How to "find" all writable files in a directory tree? In-Reply-To: References: <5 DOT 2 DOT 1 DOT 1 DOT 2 DOT 20030509150109 DOT 0658b200 AT pop DOT sonic DOT net> <5 DOT 2 DOT 1 DOT 1 DOT 2 DOT 20030509150109 DOT 0658b200 AT pop DOT sonic DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed AC, At 15:08 2003-05-09, lists AT m8y DOT org wrote: >On Fri, 9 May 2003, Randall R Schulz wrote: > > > At 14:44 2003-05-09, lists AT m8y DOT org wrote: > > >-perm +222 is redundant > > > > How do you figure? There are 8 combinations of write enable bits that > > this permission specification matches. For "-perm +2" only one bit is > > examined and there's only one way for it to succeed. > >My reading of the manual is that: >-222 examines bit 2 being on in all of the 3 areas >+2 examines bit 2 being on in all of the 3 areas >222 checks exact permissions 222 Well I can see no interpretation of the manual that supports what you're saying So... We resort to empiricism... -==--==--==-setup-==--==--==- touch 000; chmod 000 000 touch 002; chmod 002 002 touch 020; chmod 020 020 touch 022; chmod 022 022 touch 200; chmod 200 200 touch 202; chmod 202 202 touch 220; chmod 220 220 touch 222; chmod 222 222 -==--==--==-setup-==--==--==- -==--==--==-find-test-==--==--==- set -x find . -type f -perm +000 find . -type f -perm +002 find . -type f -perm +020 find . -type f -perm +022 find . -type f -perm +200 find . -type f -perm +202 find . -type f -perm +220 find . -type f -perm +222 -==--==--==-find-test-==--==--==- % setup % ls -lF total 2 ---------- 1 RSchulz None 0 May 9 15:20 000 --------w- 1 RSchulz None 0 May 9 15:20 002 -----w---- 1 RSchulz None 0 May 9 15:20 020 -----w--w- 1 RSchulz None 0 May 9 15:20 022 --w------- 1 RSchulz None 0 May 9 15:20 200 --w-----w- 1 RSchulz None 0 May 9 15:20 202 --w--w---- 1 RSchulz None 0 May 9 15:20 220 --w--w--w- 1 RSchulz None 0 May 9 15:20 222 -rwxrwxr-x 1 RSchulz None 227 May 9 15:22 find-test* -rwxrwxr-x 1 RSchulz None 220 May 9 15:20 setup* % find-test + find . -type f -perm +000 + find . -type f -perm +002 ./002 ./022 ./202 ./222 + find . -type f -perm +020 ./020 ./022 ./220 ./222 ./find-test ./setup + find . -type f -perm +022 ./002 ./020 ./022 ./202 ./220 ./222 ./find-test ./setup + find . -type f -perm +200 ./.find-test.swp ./200 ./202 ./220 ./222 ./find-test ./setup + find . -type f -perm +202 ./.find-test.swp ./002 ./022 ./200 ./202 ./220 ./222 ./find-test ./setup + find . -type f -perm +220 ./.find-test.swp ./020 ./022 ./200 ./202 ./220 ./222 ./find-test ./setup + find . -type f -perm +222 ./.find-test.swp ./002 ./020 ./022 ./200 ./202 ./220 ./222 ./find-test ./setup OK? Randall Schulz -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/