Monday, June 28, 2010

Is this a bug?

After spending a few hours on some ldap administration scripts for work, I came across a strange occurrence of what seemed to be corruption:

dn:: Y249dGVzdF9lbnRyeSxvdT1Ib3N0cyxvdT11bml4LGRjPWhlYWx0aCxkYz1xbGQsZGM9Z292
LGRjPWF1IA==
cn:: dGVzdF9lbnRyeSA=
ipHostNumber: 192.168.0.2
objectClass:: aXBIb3N0IA==
objectClass: top

I first thought maybe the way I was formatting the IP was causing this behaviour, but a few tests proved this theory was incorrect.

I then thought I had a corrupt 'ldapmodify' binary, so I tried the script on a different machine and got the same behaviour.

After a few attempts on a few different machines using ldapmodify and taking input from STDIN, I was then lead to believe ldif file some how had a special character in it that 'cat' wasn't picking up.

The octal dump says it all, there was a space at the end of the 'dn' line and a space at the end of the 'ipHostNumber' entry. This kind of explains why the same content coming from STDIN didn't produce the same odd behaviour.

Very strange, I didn't think ldapmodify was so anal ..... is this a bug?



No comments: