X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=scripts%2Fradiusd2ldif.pl;h=4dbd04f7e2ed70b3735dffee57c5955814198cf1;hb=HEAD;hp=5644bc3a4bfbd79f2d861fa683b6f8c932d55faa;hpb=453fdacff5940e4ef329694a467e582de927896c;p=freeradius.git diff --git a/scripts/radiusd2ldif.pl b/scripts/radiusd2ldif.pl index 5644bc3..4dbd04f 100755 --- a/scripts/radiusd2ldif.pl +++ b/scripts/radiusd2ldif.pl @@ -60,7 +60,7 @@ # ----------------------------------------------------------------------- -# TODO: +# TODO: # currently does not encrypt passwords (takes them from outside file) # Command line options @@ -72,7 +72,7 @@ use Getopt::Std; 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) @@ -144,14 +144,14 @@ $addgroup = $addgroup."\ncn: $groupname"; # { "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"; @@ -211,7 +211,7 @@ while ($line=) { } # 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; @@ -220,7 +220,7 @@ while ($line=) { $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++) { @@ -255,7 +255,7 @@ while ($line=) { } } # of if line } # of if startentry - + } # of while