01-18-2013 08:51 AM
I found this very useful documentation of packet filtering in BB10. The problem is now, how do I gain O_RDWR access to the /dev/pf device? I noticed there is no su or root profile available?
01-18-2013 09:20 AM
01-18-2013 09:49 AM
The documentation comes from QNX, which is used widely outside of BB10, so what you see there sometimes covers things which are not available to third-party apps running on BB10.
In this case, check the permissions of the device in question:
$ ls -l /dev/pf nrw-rw---- 1 root nto 0 Jan 18 09:45 /dev/pf
Owned by root, r/w access from the nto group, neither of which is anything we can get at.
If there is some documented API that explicitly says a BB10 app can use it to access the PF stuff, or if you can find a command line utility that's got "world" executable executable permissions, then you could use that. I'm 99.5% sure you won't find it as this is the sort of thing that's tightly controlled in BB10 to preserve the system security.
I'm equally confident you'd see it covered by a "restricted app permission" and since I see no such permission listed, I think you can give up on this possibility.
If you have a need for it (and unless someone tells us I'm wrong about this), you could file a Feature Request in the Jira issue tracker describing your use case.