convertSambaAccount doesn't handle machine accounts

Brad Langhorst brad at langhorst.com
Sat Sep 13 02:07:02 GMT 2003


it leaves 
primarygroupid in there because
	if ( $entry->get_value( "primaryGroupID" ) ) {
return false when the value is 0

machine account have a 0 value in that field

this patch makes the ldif work with slapadd but i don't know what samba
will do with groups like
 S-1-5-21-AAAAAAAAA-NNNNNNNN-XXXXXXX-0

I also had to modify all the machine accounts to include the
objectClass: account

diff -u -r1.3.2.3 convertSambaAccount
--- convertSambaAccount 28 Aug 2003 16:21:26 -0000      1.3.2.3
+++ convertSambaAccount 13 Sep 2003 02:05:45 -0000
@@ -170,7 +170,7 @@
                $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" ) );




More information about the samba-technical mailing list