Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-updates-src > by-pkgid > 17bc05afa7c5bf7f3db68aa9b10933b0 > files > 29

openssh-6.6p1-5.7.mga5.src.rpm

#!/usr/bin/perl 

use MIME::Base64;

$file=$ARGV;

$DEFAULT_BASE = "dc=padl,dc=com";
if (defined($ENV{'LDAP_BASEDN'})) {
	$DEFAULT_BASE = $ENV{'LDAP_BASEDN'};
}

open(FH,"authorized_keys") or die "Can't open $_: $!\n";
#open(FH,$file) or die "Can't open $file: $!\n";
@list = <FH>;
close FH;
chomp @list;
foreach (@list) {
~ /(.+)\s(\w+)\@(.+$)/;
$warez=$1;
$uid=$2;
$warez64 = encode_base64("$warez");
$warez64 =~ s/\n//g;
print "dn: uid=$uid,ou=People,$DEFAULT_BASE\n";
print "changetype: modify\n";
print "add: objectClass\n";
print "objectClass: strongAuthenticationUser\n";
print "userCertificate;binary:: $warez64\n\n";
}
exit;