Hi,

I'm trying to develop a tool for synchronising a remote OpenLDAP directory,
using Net::LDAP, from data held on an OpenVMS system, using Perl. Along the
way, as I create a new LDAP object I want to add a default Unix-style
password to the "userPassword" attribute.

My first stab at this uses a routine which works fine on Unix:

sub Crypt {
   my($word) = @_;
   my($salt,$pwd);

   $salt = join '', ('.', '/', 0..9, 'A'..'Z','a'..'z')[rand 64, rand 64];

   $pwd = crypt($word,$salt);

   $pwd;
}

However, the output generated doesn't seem to be valid. For instance, the
VMS Perl routine generates (in hex):

        f9 dc 7d 4c b5 fa 8b b7

for a salt value of IH, whereas a Unix system generates:

        IHEpNxwbz7lFs

Is this one of those Unix-ish areas that hasn't been ported? Is it likely to
be in the future?

I'm using Perl version 5.005_03.

Thanks,
Dave

--  
David Morriss, Computing Services,           | Tel: +44 (0)131 451 3262 (DDI)
Heriot-Watt University, Edinburgh, EH14 4AS, | FAX: +44 (0)131 451 3261
Scotland, UK                                 | [EMAIL PROTECTED] 

Reply via email to