We have seen that a test NodeJs simple snap daemon is able to call os.networkInterfaces()
without any special app permissions. os.networkInterfaces()
calls getifaddrs()
(https://github.com/nodejs/node/blob/5fad0b93667ffc6e4def52996b9529ac99b26319/deps/uv/src/unix/linux-core.c#L672) under the covers.
Is this expected? You can’t get the MAC address through sysfs
unless you have network-observe
so it seems strange that it would work with other methods.
I’ve seen some other forum posts where posters were seeing the call fail when the snap didn’t have permissions but that was a few years ago:
- [Error] Failed to retrieve list of network interfaces on Raspbian Buster
- Using ROS2 snaps in strict mode gives error (there was some other related permission errors here).