hexafraction
Posts: 1
Joined: Mon Mar 09, 2015 5:06 pm

Setuid or something similar for Pi4J?

Mon Mar 09, 2015 5:12 pm

Hi, I'm writing an application using Maven, that will be fairly complex, and so I don't feel that it is secure or responsible for it to be running as root, with access to all root capabilities. Additionally, the fact that Maven is used during development complicates things as there will now be two out-of-sync Maven repositories holding different versions of some libraries I wrote to integrate into my projects. Additionally, root means that file permissions on shared files might be screwed up completely.

Obviously, non-root by default doesn't work since /dev/mem cannot be accessed. Is there a reliable way in Java/Pi4J, to obtain the GPIO capabilities (including interrupts), via setuid?

(a udev rule to access /dev/mem might work, but wouldn't be good since the application again has too many permissions, and I also do not know how to write such a udev rule)

Thanks!

Return to “Java”