daily pastebin goal
33%
SHARE
TWEET

Untitled

a guest May 30th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env perl
  2.  
  3. use Net::LDAP;
  4.  
  5. my $user = $ENV{LDAP_USER};
  6. my $pass = $ENV{LDAP_PASS};
  7. my $host = $ENV{LDAP_HOST};
  8.  
  9. my $ldap = Net::LDAP->new($host);
  10. die "can't connect to $host $!" unless $ldap;
  11.  
  12. $res = $ldap->bind($user, password => $pass);
  13.  
  14. print "User: " . $user . "\n";
  15. print "Code: " . $res->code . "\n";
  16. print "Err:  " . $res->error . "\n";
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top