home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / c / cops_104.zip / cops_104 / yp_pass.chk < prev   
Text File  |  1992-03-10  |  886b  |  43 lines

  1. :
  2. #
  3. #  yp_pass.chk [whatever flags you want to pass to pass.chk]
  4. #
  5. #   This shell script is a wrapper for the pass.chk password guessing
  6. # program for systems using Yellow Pages/NIS.  All this does is dump the
  7. # yppassword file into a temp file, then runs "pass.chk" with whatever
  8. # flags were passed to it.
  9. #
  10. #   Obviously, it doesn't make any sense to use the "-P" flag with
  11. # this script (which specifies an alternate password file.)
  12.  
  13. TEST=/bin/test
  14. ECHO=/bin/echo
  15. RM=/bin/rm
  16. YPCAT=/usr/bin/ypcat
  17.  
  18. # Important files:
  19. yp_pass=./yp.$$
  20.  
  21. # password guessing program:
  22. pass_chk=./pass.chk
  23.  
  24. # generic test to check for yp use?
  25. if $TEST -s $YPCAT ; then
  26.     $YPCAT passwd > $yp_pass
  27. else
  28.     $RM -f $yp_pass
  29.     $ECHO Can\'t find anything to crack...
  30.     exit 1
  31.     fi
  32.  
  33. #  crack them passwords
  34. if $TEST -s "$yp_pass" ; then    
  35.     $pass_chk $* -P $yp_pass
  36.     fi
  37.  
  38. # kill off the evidence
  39. $RM -f $yp_pass
  40.  
  41. # end
  42.