Re: OT: find command permissions: how to exclude dir?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Gordon Messmer wrote:
Rick Stevens wrote:
Gordon Messmer wrote:
You need to tell find what to do with files not named .gvfs:

find /users/tburns -name .gvfs -prune -o -print

Will not work.  As soon as the non-owner of .gvfs does a stat on the
directory, the error will be spit out.  find must "stat()" any item
it finds to handle the remainder of the predicate and POP goes the
error.

If -name is the first predicate, and you prune matches, find will not need to stat() the directory entry:

[gordon@herald:~/tmp/findtest]$ find . -print
.
./noread
find: `./noread': Permission denied
./read
./read/file

[gordon@herald:~/tmp/findtest]$ find . -name noread -prune -o -print
.
./read
./read/file

Sorry, won't work for GVFS filesystem mountpoints. As soon as the non-owner touches the inode, the error occurs. Just a couple of tests
(I'm redirecting stdout just to get rid of the stuff extraneous to the
discussion):

As owner:
	[rick@bigdog ~]$ ls -lad .gv*
	dr-x------ 2 rick rick 0 2008-11-04 18:00 .gvfs
	[rick@bigdog ~]$ find . -name ".gvfs" -prune -o -print \
	>/dev/null
	[rick@bigdog ~]$

As root:
	[root@bigdog rick]# find . -name ".gvfs" -prune -o -print \
	>/dev/null
	find: ./.gvfs: Permission denied
	[root@bigdog rick]#

Note that test was on F9, x86_64.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer                      ricks@xxxxxxxx -
- AIM/Skype: therps2        ICQ: 22643734            Yahoo: origrps2 -
-                                                                    -
-  Jimmie crack corn and I don't care...what kind of lousy attitude  -
-                 is THAT to have, huh?   -- Dennis Miller           -
----------------------------------------------------------------------

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux