romilly/quick2wire-python-api

Implement some gpio_functions inside Pin class

odiroot opened this issue · 2 comments

Currently gpio_admin is called to achieve export and unexport commands, subprocess being used in the process.
I believe there's no need for that. It's better to include this features inside quick2wire Python API.
This should offer some performance gains as well.

There is a need for that. The gpio-admin executable is setuid'd to run as root, which allows the Python code to run as a non-privileged user. If the python code exported and unexported the pin's the entire process would have to run as root, increasing the security risk of any program that performed GPIO activity.

For more information, see: http://quick2wire.com/2012/05/safe-controlled-access-to-gpio-on-the-raspberry-pi/

If the Raspberry Pi GPIO driver is changed to make GPIO devices accessible to some group that users can belong to, then the gpio-admin helper program will no longer be needed. Until then it's the safest option.

Won't fix until kernel support is available.