This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: How to "find" all writable files in a directory tree?


AC,

At 15:08 2003-05-09, lists@m8y.org wrote:
On Fri, 9 May 2003, Randall R Schulz wrote:

> At 14:44 2003-05-09, lists@m8y.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]