Answer the question
In order to leave comments, you need to log in
Base64 and Active Directory: Why is the Title field not always decoded correctly?
Hello.
I'm using ldapsearch to generate my email signature, it has a Title field.
The request is like this:
title=$(ldapsearch -x -D [email protected] -w <password>"(SAMAccountName=${SAM})" title | grep "title::" | cut -d " " -f2 | base64 -d);
title:: 0KHQuNGB0YLQtdC80L3Ri9C5INCw0LTQvNC40L3QuNGB0YLRgNCw0YLQvtGA
-------
title = Системный администратор
title:: 0KDRg9C60L7QstC+0LTQuNGC0LXQu9GMINGG0LXQvdGC0YDQsCDRgNCw0LHQvtGC0Ysg0Y
-------
base64: invalid input
title = Руководитель центра работы �
Answer the question
In order to leave comments, you need to log in
Everything is very simple. The rest is on the next line of ldapsearch's response.
Try adding -o ldif-wrap=no
title=$(ldapsearch -o ldif-wrap=no -x -D [email protected] -w "(SAMAccountName=${SAM})" title | grep "title::" | cut -d " " -f2 | base64 -d);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question