For Programmers: Free Programming Magazines  


Home > Archive > LDAP > January 2008 > Net::LDAP::LDIF usage









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Net::LDAP::LDIF usage
Julien Garet

2008-01-07, 7:31 pm

Hi,

We are currently using Net::LDAP::LDIF module to transfer infos
from an openldap server to an AD ldap server. We are importing the
ldif using a Windows command called ldifde. Our problem is that
ldifde needs some formatting characters between each modification
using changetype: modify. It needs a single dash alone on a line
following the modified entry to work.
Is there a clean way to do this with Net::LDAP::LDIF ? (I have
seen some dashes in the RFC but did not yet take time to read it
intensively).

Julien Garet
INRIA Lille
Martin Fabiani

2008-01-08, 4:40 am

Hi,

the problem seems to be that you want to write a change ldif format,
not a full one? It looks as the constructor parameter change => 1
does this, but I haven't yet tested it:

my $ldif = Net::LDAP::LDIF->new( file => ..., change => 1 );

My experience with ldifde comes from Win2000, and I didn't like the
error handling and wasn't at all satisfied with it because it
couldn't import special chars like umlauts or accents it exported
from another AD because it lacked encoding the umlauts with base64
and so couldn't import objects that were exported with ldifde (but
maybe ldifde got some improvements in the meantime). Another problem
is that AD requires the charset of latin1 or cp1251 (or at least the
user manager), and so it was necessary to convert everything.

I prefer working with ADSI by Win32::OLE because the error handling
is much easier. You find a lot of examples for perl at
http://techtasks.com/code/viewbook/2

Best regards,

Martin Fabiani

At 09:03 08.01.2008, you wrote:
>Hi,
>
> We are currently using Net::LDAP::LDIF module to transfer infos
>from an openldap server to an AD ldap server. We are importing the
>ldif using a Windows command called ldifde. Our problem is that
>ldifde needs some formatting characters between each modification
>using changetype: modify. It needs a single dash alone on a line
>following the modified entry to work.
> Is there a clean way to do this with Net::LDAP::LDIF ? (I have
>seen some dashes in the RFC but did not yet take time to read it
>intensively).
>
>Julien Garet
>INRIA Lille


Software Engineering Martin Fabiani:
- Perl-Entwicklung
- Perl-Schulungen
- Metadirectories und Identity Management
- Datensynchronisierungen

mailto:martin@fabiani.net / http://www.fabiani.net/
mailto:m.fabiani@linux-services.org / http://www.linux-services.org/
mailto:strat@perl-community.de / http://www.perl-community.de/
mailto:strat@cpan.org / tel: +49-69-47885599
D-60385 Frankfurt / Roederbergweg 104

----------

Webb, Andy

2008-01-08, 7:32 pm

There are a couple issues - first, make sure you're on the latest release. =
There were a couple bugs in earlier releases that ldifde was sensitive to.

I use the following to create valid ldifde files:

my $ldifout =3D Net::LDAP::LDIF->new(">import.ldf","w",encode=3D>'base64',c=
hange=3D>'1');



-----Original Message-----
From: Martin Fabiani [mailto:martin@fabiani.net]
Sent: Tuesday, January 08, 2008 2:28 AM
To: Julien.Garet@inria.fr; Perl-LDAP Mailing List
Subject: Re: Net::LDAP::LDIF usage

Hi,

the problem seems to be that you want to write a change ldif format,
not a full one? It looks as the constructor parameter change =3D> 1
does this, but I haven't yet tested it:

my $ldif =3D Net::LDAP::LDIF->new( file =3D> ..., change =3D> 1 );

My experience with ldifde comes from Win2000, and I didn't like the
error handling and wasn't at all satisfied with it because it
couldn't import special chars like umlauts or accents it exported
from another AD because it lacked encoding the umlauts with base64
and so couldn't import objects that were exported with ldifde (but
maybe ldifde got some improvements in the meantime). Another problem
is that AD requires the charset of latin1 or cp1251 (or at least the
user manager), and so it was necessary to convert everything.

I prefer working with ADSI by Win32::OLE because the error handling
is much easier. You find a lot of examples for perl at
http://techtasks.com/code/viewbook/2

Best regards,

Martin Fabiani

At 09:03 08.01.2008, you wrote:
>Hi,
>
> We are currently using Net::LDAP::LDIF module to transfer infos
>from an openldap server to an AD ldap server. We are importing the
>ldif using a Windows command called ldifde. Our problem is that
>ldifde needs some formatting characters between each modification
>using changetype: modify. It needs a single dash alone on a line
>following the modified entry to work.
> Is there a clean way to do this with Net::LDAP::LDIF ? (I have
>seen some dashes in the RFC but did not yet take time to read it
>intensively).
>
>Julien Garet
>INRIA Lille


Software Engineering Martin Fabiani:
- Perl-Entwicklung
- Perl-Schulungen
- Metadirectories und Identity Management
- Datensynchronisierungen

mailto:martin@fabiani.net / http://www.fabiani.net/
mailto:m.fabiani@linux-services.org / http://www.linux-services.org/
mailto:strat@perl-community.de / http://www.perl-community.de/
mailto:strat@cpan.org / tel: +49-69-47885599
D-60385 Frankfurt / Roederbergweg 104

----------
Simonerrrr

2008-01-26, 10:27 pm

Jessica Alba and Catherine Z. Jones Seducing Waitress!
http://www.bestbloggin.com/Watch?vid=726071

Jessica Alba and Lindsay Lohan In Pussy Cucumber!
http://www.bestbloggin.com/WindowsM...er.asp?q=726071

Heather Locklear and Ashlee Simpson Pussy Licking & Fighting!
http://www.bestbloggin.com/watch?vid=726071

Pamela Anderson and Cameron Diaz playing with each other on film!
http://www.bestbloggin.com/Watch?q=726071

Christina Applegate and Alyssa Milano In A Lesbian Catfight!
http://www.bestbloggin.com/Player.asp?movie=726071
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com