Anton PalkoBrosov via FreeIPA-users wrote:
> Hi, i am trying to make callback which will make API calls to external system 
> when new user created.
> So i puts the script to "/usr/lib/python2.7/site-packages/ipaserver/plugins", 
> give execute priveleges to file and restart freeipa server.
> Greating new user in GUI - so folder is not creating.
> In my script i just programmed simple action - creation of folder.
> Script:
> import os
> from ipalib.plugins.user import user_add
> from ipalib import api, plugable
>  
> def verify_shell_cb(self, ldap, dn, entry_attrs, *keys, **options):
>     folder_path = '/home/freeipa/suka'
>     if not os.path.exists(folder_path):
>         os.makedirs(folder_path)
> user_add.register_post_callback(verify_shell_cb)
> api.register(user_add)
> 

The IPA API runs in the context of Apache as the ipaapi user. This user
does not have permission to create directories on systems. That is
likely the culprit. And I'm not suggesting you grant this access or try
to run as root.

You may be able to call out to oddjob via dbus to do this.

rob

-- 
_______________________________________________
FreeIPA-users mailing list -- freeipa-users@lists.fedorahosted.org
To unsubscribe send an email to freeipa-users-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/freeipa-users@lists.fedorahosted.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to