# -----------------------------------------------------------------------
-# TODO:
+# TODO:
# currently does not encrypt passwords (takes them from outside file)
# Command line options
getopts('dpmf:');
$debug = $opt_d;
-%passwords;
+%passwords;
# This might or might not be necessary depending if your LDAP server
# when importing from ldif introduces crypted passwords in the LDAP db
# (not necessary for Netscape's Directory Server)
# { "radiusLoginLATPort", "Login-LAT-Port" },
# You can change to the mappings below like this
# cat radius2ldif.pl | grep ^# | \
-# perl -ne 'if ( /\{ \"(.*?)\", \"(.*?)\" \}/ ) \
+# perl -ne 'if ( /\{ \"(.*?)\", \"(.*?)\" \}/ ) \
# { $attr=lc $2; print "\$mapping{\"$attr\"} = \"$1\";\n" ; } '
# Warning: sometimes password must be encrypted before sent to the LDAP
# Which Perl libraries are available? Only way I find is through
-# Netscape's NDS getpwenc.
-# However NDS does the cyphering even if sending plain passwords
+# Netscape's NDS getpwenc.
+# However NDS does the cyphering even if sending plain passwords
# (do all LDAP's do this?)
# TODO: test with OpenLDAP
$mapping{'password'} = "userpassword";
}
# Start line is hardcoded must be uid followed by password
# this could be changed to use any other parameter however
- if ( $line =~ /^(\w+)\s*\t*(?:User-)?Password=(\w+)/ ) {
+ if ( $line =~ /^(\w+)\s*\t*(?:User-)?Password=(\w+)/ ) {
$uid = $1;
$password= $2;
$password = $passwords{$password} if $opt_f;
$dn=$predn.$uid.$basedn; # Start of LDIF entry
$header = "$dn\n";
push @userlist, $dn;
- if ( $opt_m ) {
+ if ( $opt_m ) {
$header= $header."changetype: modify\n";
} else {
for (my $i=0; $i < $#objectClass+1; $i++) {
}
} # of if line
} # of if startentry
-
+
} # of while