nRF Sniffer Linux Lock File Permissions Problem

I have successfully setup my nRF51822 chip with Wireshark to capture BLE packets, using the 4.0.0 release of the nRF Sniffer software (extcap folder). However, the capture interface only shows up on Wireshark when I run Wireshark as root.

One issue I have identified as causing this is that the lockfile the extcap software tries to create fails (PermissionError: [Errno 13] Permission denied: '/var/lock/LCK..ttyUSB0').

However, even removing this from the script, it still does not show up in Wireshark when run without root privileges.

Any guidance as to how to avoid running Wireshark as root in this situation would be helpful.

Parents
  • This thread is old, but I downloaded the sniffer software today, and the problem is still there. The code in Lockfile.py won't work on most modern Linux systems. I am use Fedora 37.

    The code tries to use traditional lock files in /var/lock for the serial port, but messes them up. Root status is needed on modern Linux machines to create and write files in /var/lock (or /run/lock, depending on the system). So, they put the lock files for things like serial ports in a subdirectory called /var/lock/lockdev, which anyone can write to. I changed Lockfile.py to use /var/lock/lockdev , but it still gets things wrong. It never removes the locks it has created, even when you run the software as root. For the moment I have disabled the locking and unlocking code, by simply changing the tests in Filelock.py to look for the system be an "xlinux" one, instead of a "linux" one. Now I can capture OK.

Reply
  • This thread is old, but I downloaded the sniffer software today, and the problem is still there. The code in Lockfile.py won't work on most modern Linux systems. I am use Fedora 37.

    The code tries to use traditional lock files in /var/lock for the serial port, but messes them up. Root status is needed on modern Linux machines to create and write files in /var/lock (or /run/lock, depending on the system). So, they put the lock files for things like serial ports in a subdirectory called /var/lock/lockdev, which anyone can write to. I changed Lockfile.py to use /var/lock/lockdev , but it still gets things wrong. It never removes the locks it has created, even when you run the software as root. For the moment I have disabled the locking and unlocking code, by simply changing the tests in Filelock.py to look for the system be an "xlinux" one, instead of a "linux" one. Now I can capture OK.

Children
Related