Guest User

Untitled

a guest
Nov 17th, 2015
25
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/perl -wl
  2.  
  3. use URI::Escape;
  4.  
  5. $|=1; # don't buffer stdout
  6.  
  7. while (<>) {
  8. open(DATEI,">>","/sap/squid/datei.dat");
  9.  
  10. ($user, $dest) = split;
  11. $user =~ s/%(..)/pack("H*", $1)/ge;
  12. $dest =~ s/%(..)/pack("H*", $1)/ge;
  13.  
  14. @newline='';
  15. $string = $user . " : " . $dest . " <---";
  16. push(@newline,$string);
  17. print DATEI @newline;
  18.  
  19. $dest = uri_unescape($dest);
  20. $user = uri_unescape($user);
  21.  
  22. $str = valid($user);
  23.  
  24. if ($str eq "jens") {
  25. print "OK user=" . $str;
  26. } else {
  27. print "ERR";
  28. }
  29. } continue {
  30. close(DATEI);
  31. }
  32.  
  33. sub valid {
  34. my $user = shift;
  35. if ($user eq "jens") {
  36. return $user; } else { return "empty"; }
  37. }
RAW Paste Data