Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set thumbnailPhoto #41

Open
peterbeck opened this issue Jun 26, 2017 · 1 comment
Open

set thumbnailPhoto #41

peterbeck opened this issue Jun 26, 2017 · 1 comment

Comments

@peterbeck
Copy link

Hi guys,

how do you set the thumbnailPhoto attribute for a user ? is it even possible right now ?
I used to have some ldap-snippets to set the user picture, but it's not really satisfiying:

My current solution is deploying the picture and then use an exec with ldbmodify unless the "thumbnailPhoto" attribut is found with ldbsearch....

dn: CN=<%= @given_name %>,CN=Users,<% @realm.split('.').each do |rlm| %>,DC=<%= "#{rlm}" %><% end %>
changetype: modify
add: thumbnailPhoto
thumbnailPhoto:< file:///opt/samba4/pics/<%= @name %>.png

it would be nice if there is any way to use smb_user to add user pictures.
Or a hint how you do it ;-)

Regards
Peter

@kakwa
Copy link
Owner

kakwa commented Jun 26, 2017

The setting of binary attributes doesn't work well.

The provider part that set these attributes is here:

This provider relies heavily on additional-samba-tool. additional-samba-tool is a small python script using the samba 4 python library and permitting to list/modify user's attributes.

The logic behind this provider is:

  • additional-samba-tool is called by the smb_user type provider to list user's attributes and display it as yaml in stdout.
  • the yaml stdout is recovered by the provider and parsed by the provider.
  • Then the provider check if the values are set correctly.
  • If not, the provider uses additional-samba-tool again to set/create the attribute with the correct value.

The issue is that there is no special handling of binary attributes such as thumbnailPhoto. For this to properly work, they should be printed as base64 in additional-samba-tool "list" mode, and additional-samba-tool should have a switch in "set" mode to handle data passed as base64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants