1998-01-16 15:13:05 +03:00
|
|
|
#! /usr/local/bin/ruby
|
1999-08-13 09:45:20 +04:00
|
|
|
|
|
|
|
path = ENV['PATH'].split(File::PATH_SEPARATOR)
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
for dir in path
|
1999-01-20 07:59:39 +03:00
|
|
|
if File.directory?(dir)
|
1998-01-16 15:13:05 +03:00
|
|
|
for f in d = Dir.open(dir)
|
2011-05-15 15:55:52 +04:00
|
|
|
fpath = File.join(dir, f)
|
1999-01-20 07:59:39 +03:00
|
|
|
if File.file?(fpath) && (File.stat(fpath).mode & 022) != 0
|
2013-07-20 17:41:02 +04:00
|
|
|
printf("file %s is writable from other users\n", fpath)
|
1998-01-16 15:13:05 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
d.close
|
|
|
|
end
|
|
|
|
end
|