[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Wed Jan 23 02:52:03 MST 2013


The branch, master has been updated
       via  3d1abb9 waf: Fix pdb_ldap which cannot be built as a module.
       via  38a52f7 ldap: Remove obsolete convertSambaAccount script.
      from  988350c libcli/auth: fix void function cannot return value error

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 3d1abb93280fbfe01ed899fa4685290ce3960ed8
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Jan 22 09:55:02 2013 +0100

    waf: Fix pdb_ldap which cannot be built as a module.
    
    The module has two init functions, pdb_ldap_init() and
    pdb_ldapsam_init(). As a shared module only one can be found until we
    create a symlink.
    
    Reviewed-by: Günther Deschner <gd at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Wed Jan 23 10:51:59 CET 2013 on sn-devel-104

commit 38a52f71255541fd5d57e6e4fbc1acbe780a10cb
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Jan 22 10:04:07 2013 +0100

    ldap: Remove obsolete convertSambaAccount script.
    
    We removed ldapsam_compat support which used sambaAccount already some
    time ago. See commit 02c239c6d35f47f13143c66baffbd303373b8028.
    
    Reviewed-by: Günther Deschner <gd at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 examples/LDAP/convertSambaAccount |  233 -------------------------------------
 source3/passdb/wscript_build      |    6 +-
 2 files changed, 4 insertions(+), 235 deletions(-)
 delete mode 100755 examples/LDAP/convertSambaAccount


Changeset truncated at 500 lines:

diff --git a/examples/LDAP/convertSambaAccount b/examples/LDAP/convertSambaAccount
deleted file mode 100755
index 8b522ef..0000000
--- a/examples/LDAP/convertSambaAccount
+++ /dev/null
@@ -1,233 +0,0 @@
-#!/usr/bin/perl  -w
-##
-## Convert an LDIF file containing sambaAccount entries
-## to the new sambaSamAccount objectclass
-##
-## Copyright Gerald (Jerry) Carter	2003
-##
-## Usage: convertSambaAccount --sid=<Domain SID> \
-##       --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;
-use Net::LDAP::LDIF;
-use Getopt::Long;
-
-
-##############################################################################
-## local variables
-
-my ( $domain, $domsid, $changetype );
-my ( $ldif, $ldif2 );
-my ( $entry, @objclasses, $obj );
-my ( $is_samba_account, $is_samba_group );
-my ( %attr_map, %group_attr_map, $key );
-my ( @dels, $deletion, @adds, $addition );
-my ( $result, %options );
-
-
-##############################################################################
-## Print the option usage
-
-sub usage {
-
-	print "convertSambaAccount <options>\n";
-	print "Options:\n";
-	print "  --help         print this help message\n";
-	print "  --input        input LDIF filename\n";
-	print "  --output       output LDIF filename\n";
-	print "  --sid          domain SID\n";
-	print "  --changetype   [modify|add] (default is 'add')\n";
-}
-
-
-##############################################################################
-##                               MAIN DRIVER                                ##
-##############################################################################
-
-##
-## hashes to map old attribute names to new ones 
-##
-
-%attr_map = ( 
-	lmPassword	=> 'sambaLMPassword',
-	ntPassword	=> 'sambaNTPassword',
-	pwdLastSet	=> 'sambaPwdLastSet',
-	pwdMustChange	=> 'sambaPwdMustChange',
-	pwdCanChange	=> 'sambaPwdCanChange',
-	homeDrive	=> 'sambaHomeDrive',
-	smbHome		=> 'sambaHomePath',
-	scriptPath	=> 'sambaLogonScript',
-	profilePath	=> 'sambaProfilePath',
-	kickoffTime	=> 'sambaKickoffTime',
-	logonTime	=> 'sambaLogonTime',
-	logoffTime	=> 'sambaLogoffTime',
-	userWorkstations	=> 'sambaUserWorkstations',
-	domain		=> 'sambaDomainName',
-	acctFlags	=> 'sambaAcctFlags',
-);
-
-%group_attr_map = (
-	ntSid		=> 'sambaSID',
-	ntGroupType	=> 'sambaGroupType',
-);
-
-##
-## process command line args
-##
-
-$result = GetOptions(\%options,
-			"help", 
-			"input=s", 
-			"output=s", 
-			"sid=s",
-			"changetype=s");
-
-if (!$result && ($#ARGV != -1)) {
-	usage();
-	exit 1;
-}
-
-if ( defined($options{'help'}) ) {
-	usage();
-	exit 0;
-}
-
-
-if ( !defined( $options{'sid'} ) ) {
-	print "You must provide a domain sid\n";
-	exit 1;
-}
-
-$domsid = $options{'sid'};
-
-$changetype = 'add';
-if ( defined( $options{'changetype'} ) ) {
-	$changetype = $options{'changetype'};
-}
-
-##
-## open files
-##
-
-$ldif = Net::LDAP::LDIF->new ($options{'input'}, "r") or die $!;
-
-if ( "$changetype" eq "add" ) {
-	$ldif2 = Net::LDAP::LDIF->new ($options{'output'}, "w") or die $!;
-}
-elsif ( "$changetype" eq "modify" ) {
-	open( OUTPUT, ">$options{'output'}" ) or die $!;
-}
-else {
-	print "Bad changetype!\n";
-	exit 1;
-}
-
-##
-## process LDIF 
-##
-
-while ( !$ldif->eof ) {
-	undef ( $entry );
-	$entry = $ldif->read_entry();
-
-	## skip entry if we find an error
-	if ( $ldif->error() ) {
-		print "Error msg: ",$ldif->error(),"\n";
-		print "Error lines:\n",$ldif->error_lines(),"\n";
-		next;
-	}
-
-	##
-	## check to see if we have anything to do on this
-	## entry.  If not just write it out
-	##
-	@objclasses = $entry->get_value( "objectClass" );
-	undef ( $is_samba_account );
-	undef ( $is_samba_group );
-	@adds = ();
-	@dels = ();
-	foreach $obj ( @objclasses ) {
-		if ( lc($obj) eq "sambaaccount" ) {
-			$is_samba_account = 1;
-		} elsif ( lc($obj) eq "sambagroupmapping" ) {
-			$is_samba_group = 1;
-		}
-	}
-
-	if ( defined ( $is_samba_account ) ) {
-		##
-		## start editing the sambaAccount
-		##
-
-		@dels = ( 'objectclass: sambaAccount', 'rid' );
-		@adds = ('objectclass: sambaSamAccount', "sambaSID: " .  ${domsid} . "-" . ${entry}->get_value( 'rid' ) );
-		$entry->delete( 'objectclass' => [ 'sambaAccount' ] );
-		$entry->add( 'objectclass' => 'sambaSamAccount' );
-
-		$entry->add( 'sambaSID' => $domsid."-".$entry->get_value( "rid" ) );
-		$entry->delete( 'rid' );
-	
-		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" ) );
-			$entry->delete( 'primaryGroupID' );
-		}
-	
-
-		foreach $key ( keys %attr_map ) {
-			if ( defined($entry->get_value($key)) ) {
-				push @adds, "$attr_map{$key}: " . $entry->get_value($key);
-				push @dels, "$key";
-				$entry->add( $attr_map{$key} => $entry->get_value($key) );
-				$entry->delete( $key );
-			}
-		}
-	} elsif ( defined ( $is_samba_group ) ) {
-		foreach $key ( keys %group_attr_map ) {
-			if ( defined($entry->get_value($key)) ) {
-				push @adds, "$group_attr_map{$key}: " . $entry->get_value($key);
-				push @dels, "$key";
-				$entry->add( $group_attr_map{$key} => $entry->get_value($key) );
-				$entry->delete( $key );
-			}
-		}
-	}
-	
-	## see if we should write full entries or only the changes
-	
-	if ( "$changetype" eq "add" ) {
-		$ldif2->write_entry( $entry );
-	}
-	else {
-		if ( defined ( $is_samba_account ) || defined ( $is_samba_group ) ){
-			if ( @adds + @dels > 0 ) {
-				print OUTPUT "dn: " . $entry->dn . "\n";
-				foreach $addition (@adds) {
-					$addition =~ /(^\w+):/;
-					print OUTPUT "add: " . $1  . "\n";
-					print OUTPUT "$addition\n-\n";
-				}
-				foreach $deletion (@dels) {
-					if ( $deletion =~ /^(\w+):\s(.*)/ ) {
-						print OUTPUT "delete: $1\n$1: $2\n-\n";
-					} else {
-						print OUTPUT "delete: $deletion\n-\n"
-					}
-				}
-				print OUTPUT "\n"
-			}
-		}
-	}
-}
-
-
diff --git a/source3/passdb/wscript_build b/source3/passdb/wscript_build
index 03a0df4..03c8b56 100644
--- a/source3/passdb/wscript_build
+++ b/source3/passdb/wscript_build
@@ -13,13 +13,15 @@ bld.SAMBA3_MODULE('pdb_tdbsam',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('pdb_tdbsam'),
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('pdb_tdbsam'))
 
+# This cannot be built as a shared module cause it has two init functions. The
+# code needs to be cleaned up and split to allow this.
 bld.SAMBA3_MODULE('pdb_ldap',
                  subsystem='pdb',
                  deps='smbldap smbldaphelper',
                  source=PDB_LDAP_SRC,
                  init_function='',
-                 internal_module=bld.SAMBA3_IS_STATIC_MODULE('pdb_ldap'),
-                 enabled=bld.SAMBA3_IS_ENABLED_MODULE('pdb_ldap') and bld.CONFIG_SET('HAVE_LDAP'))
+                 internal_module=True,
+                 enabled=bld.CONFIG_SET('HAVE_LDAP'))
 
 bld.SAMBA3_MODULE('pdb_smbpasswd',
                  subsystem='pdb',


-- 
Samba Shared Repository


More information about the samba-cvs mailing list