Hi!
I'm writing a PAM module that should call Python functions (from a script) to do the security stuff. So I have to call Python functions from the *.so file and, moreover, provide the script with the ability to call C++ functions defined in the same *.so module (like functions for getting the username with pam_get_user()).
So now, my problems:
1. when i import the python module with PyImport_Import() (just like in the Python/C API Reference from python.org) i get the following error:
'import site failed'
There is no 'import site' in my script, only a simple function. I found a solution in the newsgroups, telling me to create an empty site.py and a lib-dynload directory and set $PYTHONPATH to those. I did that. It helped, there is no 'import site failed', but...
... now i can't import any other python modules in the script, and I need to import the 'dl' module in order to load the *.so and call the C++ functions.
Any help?
2. I have problems with making the C++ functions in a test *.so file callable for a Python script. I write the C++ source, compile it with -shared to get the *.so, but then, when in Python shell I import the *.so (with dl.open()) and try to call a functions from it, it says that there is no such function defined in the module.
Does anyone have any examples on calling C++ functions from Python and making such *.so files?
If you need me to write more on my problems or provide the code I'm using, just tell.

It's kinda urgent so I'll be gratefull for any help.
