Actions
Bug #13749
closedGetting avatar from openldap seems to be broken
Status:
Closed
Priority:
Normal
Assignee:
Category:
Authentication
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Description
I created a user with the following ldif:
dn: cn=dgoetz,ou=users,dc=localdomain objectClass: inetOrgPerson cn: dgoetz sn: Goetz description: Dirk Goetz userPassword: {SSHA}SmI4N/QECJfMFprv9sMnTD7KZUq46Yw8 givenName: Dirk mail: dgoetz@localdomain uid: dgoetz jpegPhoto:< file:///root/dgoetz.jpg
When I login with the user the avatar is downloaded and the file is created but is not a valid picture.
# file /var/lib/foreman/public/assets/avatars/6e15a0e85405ddd9f25abc3aee0b212ea2ca6bfb.jpg /var/lib/foreman/public/assets/avatars/6e15a0e85405ddd9f25abc3aee0b212ea2ca6bfb.jpg: data
If I search the ldap I get:
# dgoetz, users, localdomain dn: cn=dgoetz,ou=users,dc=localdomain objectClass: inetOrgPerson cn: dgoetz sn: Goetz description: Dirk Goetz userPassword:: e1NTSEF9U21JNE4vUUVDSmZNRnBydjlzTW5URDdLWlVxNDZZdzg= givenName: Dirk mail: dgoetz@localdomain uid: dgoetz jpegPhoto:: /9j/4AAQSkZJRgABAQEBZwFnAAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAA BtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAQA A9tYAAQAAAADTLUhQICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAABFjcHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFlaA AACGAAAABRnWFlaAAACLAAAABRiWFlaAAACQAAAABRkbW5kAAACVAAAAHBkbWRkAAACxAAAAIh2dW VkAAADTAAAAIZ2aWV3AAAD1AAAACRsdW1pAAAD+AAAABRtZWFzAAAEDAAAACR0ZWNoAAAEMAAAAAx yVFJDAAAEPAAACA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AAAAAAAAAAAAAAAAQP/aAAgBAwEBPwEH/8QAFBEBAAAAAAAAAAAAAAAAAAAAQP/ aAAgBAgEBPwEH/8QAKRAAAgEDAgQFBQAAAAAAAAAAAQIDAAQRITEFEBITIiMyUWFDUnGBof/aAAgB AQAGPwKjCmrKMt8URsw59yLvPcHGFjbHh+aEjPI7OPq7jli4fu3RGVto/Ufz7CpZuNPNYhdYGtCcg fb+6lxbCXhhPlwE+JF23pns3IkT1wyaMtX11KcvJMx/ugrUZ5PNbP0OydBx7V//xAAhEAEAAQMDBQ EAAAAAAAAAAAABEQAhMRBBUWFxgZHBsf/aAAgBAQABPyGohA6ZiDipTNyfdYU2KYscHN6G0G0N5h9 ukyGTQNn9D4mhWchwy7TPVzxRCeSPMAi+7EsmVoAdEbu43OpTM7wOCzsAB4q8gs5xUqeskijIflf/ 2gAMAwEAAgADAAAAEIBJBJJIBP/EABQRAQAAAAAAAAAAAAAAAAAAAED/2gAIAQMBAT8QB//EABQRA QAAAAAAAAAAAAAAAAAAAED/2gAIAQIBAT8QB//EAB0QAQEAAgIDAQAAAAAAAAAAAAERACExYRBBUZ H/2gAIAQEAAT8QzhIjdTppqx61zgv7AdtHgPsd/j88mGSFiSuhFBbtwLMaiEaB34tg7tFqKdMj7GM QmJH+EYqhXKyfriMZJ8dnIbYLCVxzogN3CCivsTgY6xhJuzNA6ZPgw1uKCor7nYY7QAKVPrs5/9k=
And if I copy the base64 string to a file, join the lines and decode it, I get a valid jpeg back.
# cat /tmp/base64 | base64 -d > /tmp/dgoetz.jpg # file /tmp/dgoetz.jpg /tmp/dgoetz.jpg: JPEG image data, JFIF standard 1.01
So something seems to be broken, but looking in the code I have no idea what. When I tried to remove the decoding and output the file in binary I already got some content not maching the base64 string and if output was not written binary I got an empty file. Also removing the to_utf8 for testing showed the same result.
Actions