Friday, January 18, 2013

Fixing 10.8.x ldapdl error messages

If you have a lot of entry in your OSX 10.8+ logs like this
Error loading /System/Library/Security/ldapdl.bundle/Contents/MacOS/ldapdl: dlopen(/System/Library/Security/ldapdl.bundle/Contents/MacOS/ldapdl, 262): no suitable image found. Did find:
/System/Library/Security/ldapdl.bundle/Contents/MacOS/ldapdl: mach-o, but wrong architecture

that means the programs make those log enties are trying to load the ldapdl binary from a 32 bit application and unfortunately the ldapdl version came with 10.8 is a 64 bit only binary. As a temporary solution (till those programs not updated to theirs 64 bitcounter part) you can make an unibin version from an earlier 32 and the current 64 bit version.

1. copy the 10.7.x version of the binary to a temp place, I've used my desktop

2. extract the 32 bit binary from a 10.7.x version to a temp place, that was may desktop too
lipo -extract i386 -output ~/Desktop/ldapdl ~/Desktop/ldapdl.bundle/Contents/MacOS/ldapdl

3. extract the 64 bit binary from the 10.8.x version to a temp place, that was may /var/tmp
lipo -extract x86_64 -output /var/tmp/ldapdl /System/Library/Security/ldapdl.bundle/Contents/MacOS/ldapdl

4. Backup your old 10.8.x binary
sudo mv /System/Library/Security/ldapdl.bundle/Contents/MacOS/ldapdl your_backup_place

5. Put the i386 and x86_64 versions together to the official place
sudo ~/Desktop/ldapdl /var/tmp/ldapdl -create -output /System/Library/Security/ldapdl.bundle/Contents/MacOS/ldapdl

6. Correct the owner of the produced file
sudo chown root:wheel /System/Library/Security/ldapdl.bundle/Contents/MacOS/ldapdl

7. Check if everything was fine.
ls /System/Library/Security/ldapdl.bundle/Contents/MacOS/ldapdl
-rwxr-xr-x 1 root wheel 219968 Jan 18 13:12 /System/Library/Security/ldapdl.bundle/Contents/MacOS/ldapdl*

lipo -info /System/Library/Security/ldapdl.bundle/Contents/MacOS/ldapdl
Architectures in the fat file: /System/Library/Security/ldapdl.bundle/Contents/MacOS/ldapdl are: i386 x86_64

Original tip can be found here, thanks!

8 comments:

Juan A. Bertolin said...

Hi,

I am facing that problema now. How could I get the binary? I only have a DVD Snow Leopard but I am not able to find the appropriate file.

Thanks
JAB

Hofi said...

I can send you the file or the unibin version too if you trust me enough :)

Juan A. Bertolin said...

Thanks, however I would be more grateful if you could teach me how to extract from the DVD SnowLeopard the file. Should I open it from my Mountail Lion running or should I start up the MBP with the CD and transfer the file into a USB?

Thanks

Hofi said...

It is located in

''/Volumes/Mac OS X Install DVD/System/Installation/Packages/Essentials.pkg''

Open the package (double click on it) and after the installer started press CMD+I, that will list the content of the package and you can look for ldapdl.bundle in it.
Inside the package it will be at the ./System/Library/Security/ldapdl.bundle

You can extratct it f.e. using Pacifist (http://www.charlessoft.com/)

ChrilleP said...

getting
lipo: input file (/var/tmp/ldapdl) must be a fat file when the -extract option is specified

Hofi said...

at which step? what was the command line exatly you entered? /var/tmp/ldapdl should be the ouptput not the input in the examples above.

ChrilleP said...

lipo -extract x86_64 -output /var/tmp/ldapdl /System/Library/Security/ldapdl.bundle/Contents/MacOS/ldapdl

Hofi said...

what is the ouptut of :

lipo -info /System/Library/Security/ldapdl.bundle/Contents/MacOS/ldapdl

what's your os version?