home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / rbemx144.zip / ruby-1.4.4 / sample / trojan.rb < prev    next >
Text File  |  1999-08-13  |  333b  |  16 lines

  1. #! /usr/local/bin/ruby
  2.  
  3. path = ENV['PATH'].split(File::PATH_SEPARATOR)
  4.  
  5. for dir in path
  6.   if File.directory?(dir)
  7.     for f in d = Dir.open(dir)
  8.       fpath = dir+"/"+f  
  9.       if File.file?(fpath) && (File.stat(fpath).mode & 022) != 0
  10.     printf("file %s is writable from other users\n", fpath)
  11.       end
  12.     end
  13.     d.close
  14.   end
  15. end
  16.