I'm on an android, using adb shell
to troubleshoot an issue which my app has with the file system. I'm encountering a permissions error when using tinyalsa, so I wish to investigate the directories involved.
cannot open device '/dev/snd/pcmC1D0c': Permission denied
If I su
and then stat
each item in the path, the shell tells me the following permissions:
/ (755/drwxr-xr-x)
/dev/ (755/drwxr-xr-x)
/dev/snd/ (755/drwxr-xr-x)
If I try to stat /dev/snd
without su
, however, I get Permission denied
.
Why would this be? I've even tried su -c 'chmod -R a+rx /dev/snd'
, but that makes no difference.
I don't know much in this area, but it appears that SELinux is interfering. If you disable it:
...you can experience the permissions that you see when you run
stat
as root.This may not be the optimal solution, but it will allow you to perform the actions needed. I recommend reading up on SELinux if you are developing for anything but a very exclusive user base.