diff options
author | Gerald Carter <jerry@samba.org> | 2003-08-28 16:38:59 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-08-28 16:38:59 +0000 |
commit | b3f1b28e1e6efb32ff8e9536a45216edffda0eff (patch) | |
tree | d01195bd969c2fb7da1411bbc60665fe6f5a16cd /examples/LDAP/export_smbpasswd.pl | |
parent | 3d393502e7d9d40454c13dfc590ed0b16a74edaf (diff) | |
download | samba-b3f1b28e1e6efb32ff8e9536a45216edffda0eff.tar.gz samba-b3f1b28e1e6efb32ff8e9536a45216edffda0eff.tar.bz2 samba-b3f1b28e1e6efb32ff8e9536a45216edffda0eff.zip |
removing outdated scripts and adding comments about 'ldap password syc'
(This used to be commit 29885eae591bdbb899d18ac2e7ae355751cd4be6)
Diffstat (limited to 'examples/LDAP/export_smbpasswd.pl')
-rw-r--r-- | examples/LDAP/export_smbpasswd.pl | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/examples/LDAP/export_smbpasswd.pl b/examples/LDAP/export_smbpasswd.pl deleted file mode 100644 index e4f120bf02..0000000000 --- a/examples/LDAP/export_smbpasswd.pl +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/perl -## -## Example script to export ldap entries into an smbpasswd file format -## using the Mozilla PerLDAP module. -## -## writen by jerry@samba.org -## -## ported to Net::LDAP by dkrovich@slackworks.com - -use Net::LDAP; - -###################################################### -## Set these values to whatever you need for your site -## - -$DN="dc=samba,dc=my-domain,dc=com"; -$ROOTDN="cn=Manager,dc=my-domain,dc=com"; -$rootpw = "secret"; -$LDAPSERVER="localhost"; - -## -## end local site variables -###################################################### - -$ldap = Net::LDAP->new($LDAPSERVER) or die "Unable to connect to LDAP server $LDAPSERVER"; - -print "##\n"; -print "## Autogenerated smbpasswd file via ldapsearch\n"; -print "## from $LDAPSERVER ($DN)\n"; -print "##\n"; - -## scheck for the existence of the posixAccount first -$result = $ldap->search ( base => "$DN", - scope => "sub", - filter => "(objectclass=sambaAccount)" - ); - - - -## loop over the entries we found -while ( $entry = $result->shift_entry() ) { - - @uid = $entry->get_value("uid"); - @uidNumber = $entry->get_value("uidNumber"); - @lm_pw = $entry->get_value("lmpassword"); - @nt_pw = $entry->get_value("ntpassword"); - @acct = $entry->get_value("acctFlags"); - @pwdLastSet = $entry->get_value("pwdLastSet"); - - if (($#uid+1) && ($#uidNumber+1)) { - - $lm_pw[0] = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" if (! ($#lm_pw+1)); - $nt_pw[0] = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" if (! ($#nt_pw+1)); - $acct[0] = "[DU ]" if (! ($#acct+1)); - $pwdLastSet[0] = "FFFFFFFF" if (! ($#pwdLastSet+1)); - - print "$uid[0]:$uidNumber[0]:$lm_pw[0]:$nt_pw[0]:$acct[0]:LCT-$pwdLastSet[0]\n"; - } - -} - -$ldap->unbind(); -exit 0; - |