## --input=<input ldif> --output=<output ldif> \
## --changetype=[modify|add]
##
+## You can generate an input ldif file using:
+## $ ldapsearch -LL -x -h ldapsrv -D cn=root,dc=company,dc=com \
+## -b dc=copmany,dc=com > /tmp/samba3.alpha23.ldif
+##
+## Note the "-LL" so no additional comments are generated
+##
use strict;
@adds = ();
@dels = ();
foreach $obj ( @objclasses ) {
- if ( "$obj" eq "sambaAccount" ) {
+ if ( lc($obj) eq "sambaaccount" ) {
$is_samba_account = 1;
- } elsif ( "$obj" eq "sambaGroupMapping" ) {
+ } elsif ( lc($obj) eq "sambagroupmapping" ) {
$is_samba_group = 1;
}
}
$entry->add( 'sambaSID' => $domsid."-".$entry->get_value( "rid" ) );
$entry->delete( 'rid' );
- if ( $entry->get_value( "primaryGroupID" ) ) {
+ if ( defined($entry->get_value( "primaryGroupID" )) ) {
push @adds, "sambaPrimaryGroupSID: " . $domsid."-".$entry->get_value( "primaryGroupID" );
push @dels, "primaryGroupID";
$entry->add( 'sambaPrimaryGroupSID' => $domsid."-".$entry->get_value( "primaryGroupID" ) );