print a[2]}' | base64 -d` ifa" /> `
C
C
ChMikhail2021-12-05 19:53:21
LDAP
ChMikhail, 2021-12-05 19:53:21

How to decode ldapserash results?


I use the kiby75 script
to synchronize AD with Zimbra
There are such lines

displayName=`grep "displayName:" $userfil/$1.ad | awk '{split($0, a, ": "); print a[2]}' | base64 -d`
ifattr "displayName" "$displayName"

When this line is called, it produces
base64: invalid input

As I understand it, this recoding is because when you call it without base64, the data comes out in the form ..

0JHQsNC70LHQsNGI0L7Qsg==


How to understand what is the problem? base64 has only three arguments -d -i -v and it seems like the author's script works

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xotkot, 2021-12-05
@xotkot

there, the problem seems to arise due to a line break at the end of the data that comes in base64, try replacing
awk print with printf :

... | awk '{split ($0, a, ": "); printf a[2]}' | base64 -d`

As I understand it, this recoding is because when you call it without base64, the data comes out in the form ..

well, yes, it is used for Russian characters:
$ echo "0JHQsNC70LHQsNGI0L7Qsg==" | base64 -d
Балбашов

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question