LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-13-2010, 01:00 AM   #16
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910

This one worked OK for me:
Code:
for i in $(find / -type d -perm /o+w -regextype posix-extended -not -iregex "(/proc.*|/tmp.*)"); do find $i -type f -user root -ls; done | tee /tmp/baddies

Cheers,
Tink
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 10-13-2010, 01:26 AM   #17
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,252

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
Welll apart from a few files that could not be stated in proc my only directory returned was:
Quote:
/tmp
 
Old 10-13-2010, 01:44 AM   #18
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by grail View Post
Welll apart from a few files that could not be stated in proc my only directory returned was:
Good :}

Means your system is kosher ;}
 
Old 10-14-2010, 01:33 AM   #19
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by Tinkster View Post
This one worked OK for me:
Code:
for i in $(find / -type d -perm /o+w -regextype posix-extended -not -iregex "(/proc.*|/tmp.*)"); do find $i -type f -user root -ls; done | tee /tmp/baddies

Cheers,
Tink
I m getting following error after executing some part of script.Here it goes.

Is there anything worry about the error?

Code:
# find / -type d -perm /o+w -regextype posix-extended -not -iregex "(/proc.*|/tmp.*)"
find: warning: you have specified the -regextype option after a non-option argument -type, but options are not positional (-regextype affects tests specified before it as well as those specified after it).  Please specify options before other arguments.

/dev/shm
/OVS.20101006-014041.orig
/etc/ovs-agent/db
/etc/ocfs2
/var/ovs
/var/ovs/mount
/var/ovs/mount/C9A30A22F0C5435F8F31376E95F54107/.ovs-agent
/var/ovs/mount/C9A30A22F0C5435F8F31376E95F54107/.ovs-agent/db
/var/ovs/mount/C9A30A22F0C5435F8F31376E95F54107/publish_pool
/var/ovs/mount/C9A30A22F0C5435F8F31376E95F54107/sharedDisk
/var/ovs/mount/C9A30A22F0C5435F8F31376E95F54107/running_pool
/var/ovs/mount/C9A30A22F0C5435F8F31376E95F54107/running_pool/RHEL55
/var/ovs/mount/C9A30A22F0C5435F8F31376E95F54107/iso_pool
/var/ovs/mount/C9A30A22F0C5435F8F31376E95F54107/iso_pool/OEL5.2_32bit
/var/ovs/mount/C9A30A22F0C5435F8F31376E95F54107/seed_pool
/var/ovs/mount.20101006-014018.orig
/var/ovs/mount.20101006-014018.orig/C9A30A22F0C5435F8F31376E95F54107
/var/ovs/mount.20101006-014018.orig/C9A30A22F0C5435F8F31376E95F54107/.ovs-agent
/var/ovs/mount.20101006-014018.orig/C9A30A22F0C5435F8F31376E95F54107/.ovs-agent/db
/var/tmp
/var/tmp/.oracle
/var/run/ovs-agent
/var/spool/samba

Last edited by pinga123; 10-14-2010 at 01:37 AM.
 
Old 10-14-2010, 02:17 AM   #20
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,252

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
No I think it just means you should have -type d at the end.
 
Old 10-14-2010, 07:06 AM   #21
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
Still getting the same error.aint any one getting this error?

Quote:
# find / -perm /o+w -regextype posix-extended -not -iregex "(/proc.*|/tmp.*)" -type d
find: warning: you have specified the -regextype option after a non-option argument -perm, but options are not positional (-regextype affects tests specified before it as well as those specified after it). Please specify options before other arguments.

/dev/shm
/OVS.20101006-014041.orig
/etc/ovs-agent/db
/etc/ocfs2
/var/ovs
/var/ovs/mount
/var/ovs/mount/C9A30A22F0C5435F8F31376E95F54107/.ovs-agent
/var/ovs/mount/C9A30A22F0C5435F8F31376E95F54107/.ovs-agent/db
/var/ovs/mount/C9A30A22F0C5435F8F31376E95F54107/publish_pool
/var/ovs/mount/C9A30A22F0C5435F8F31376E95F54107/sharedDisk
/var/ovs/mount/C9A30A22F0C5435F8F31376E95F54107/running_pool
/var/ovs/mount/C9A30A22F0C5435F8F31376E95F54107/running_pool/RHEL55
/var/ovs/mount/C9A30A22F0C5435F8F31376E95F54107/iso_pool
/var/ovs/mount/C9A30A22F0C5435F8F31376E95F54107/iso_pool/OEL5.2_32bit
/var/ovs/mount/C9A30A22F0C5435F8F31376E95F54107/seed_pool
/var/ovs/mount.20101006-014018.orig
/var/ovs/mount.20101006-014018.orig/C9A30A22F0C5435F8F31376E95F54107
/var/ovs/mount.20101006-014018.orig/C9A30A22F0C5435F8F31376E95F54107/.ovs-agent
/var/ovs/mount.20101006-014018.orig/C9A30A22F0C5435F8F31376E95F54107/.ovs-agent/db
/var/tmp
/var/tmp/.oracle
/var/run/ovs-agent
/var/spool/samba

Last edited by pinga123; 10-14-2010 at 07:09 AM.
 
Old 10-14-2010, 07:18 AM   #22
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Here's an adjustment (re-ordering) of the options you are giving `find`, based on the warning message it is giving. NOTE that I did not get the same warning you are getting, BUT I *was* seeing /proc files/directories in my output when using the command you give there. After this re-ordering, I appear to be getting the right results, but you try it and see.
This would not be the first time that different versions of `find` have acted slightly differently on different systems..

Anyhow, see if this works for you (and if you like, maybe re-combine the -iregex statements into one, but whatever you like..)
Code:
find / -type d -regextype posix-extended ! -iregex "/proc.*" ! -iregex "/tmp.*" -perm /o+w
Regards & good luck!
 
Old 10-14-2010, 08:02 AM   #23
GazL
Senior Member
 
Registered: May 2008
Posts: 4,083
Blog Entries: 1

Rep: Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529
Or run something like this as an unprivileged user:
Code:
find / /boot /usr /opt -xdev -type f -writable 2>/dev/null
Just modify the mountpoints you're interested in. Can also be used with "-type d"

Oops!... Look what I just found in Slackware:
Code:
gazl@nix:~$ find / /boot /usr /opt -xdev -type d -writable 2>/dev/null
/tmp
/usr/doc/mpfr-2.4.2/examples
gazl@nix:~$ ls -ld /usr/doc/mpfr-2.4.2/examples
drwxrwxrwx 2 root root 4096 2009-11-30 02:45 /usr/doc/mpfr-2.4.2/examples
Not exactly critical, but it's wrong all the same.
 
Old 10-14-2010, 08:30 AM   #24
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,252

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
Sorry I hadn't run this find ... my results were with the script I submitted.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to edit files owned by root? maiden2 Linux - Newbie 3 12-12-2007 01:32 PM
World Writable Files ilago Linux - Security 4 10-07-2007 12:21 AM
Editing files owned by root SiW Programming 5 07-31-2007 02:36 PM
Security Warning: World Writable files found foxxer Linux - Security 7 06-04-2005 12:03 PM
vfat mount - all files are 'root' owned, but even root can't -WX d33pdream Linux - General 5 02-28-2003 03:38 AM


All times are GMT -5. The time now is 12:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration