Unsolved Need an assistence with "bluez" libray errors - sort off repost
-
MORE EDIT
**This is "what" it is
https://man7.org/linux/man-pages/man7/capabilities.7.html
Now "where to modify / implement iit ?**
CAP_NET_ADMIN
Perform various network-related operations:
* interface configuration;
* administration of IP firewall, masquerading, and
accounting;
* modify routing tables;
* bind to any address for transparent proxying;
* set type-of-service (TOS);
* clear driver statistics;
* set promiscuous mode;
* enabling multicasting;
* use setsockopt(2) to set the following socket options:
SO_DEBUG, SO_MARK, SO_PRIORITY (for a priority outside
the range 0 to 6), SO_RCVBUFFORCE, and SO_SNDBUFFORCE.EDIT ? UPDATE
I have found my ONE year old request for assistance in resolving this .
In case there is a remote possibility to resolve this. Here is my latest (2023 / Dec 5) attempt to use Qt btchat example - straight from the CURRET git version, 10:58:36: Starting /media/nov25-1/MDI/Qt-5.15.2/widgets/mainwindows/mdi/mdi... Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. qt.bluetooth.bluez: Missing CAP_NET_ADMIN permission. Cannot determine whether a found address is of random or public type. qt.bluetooth.bluez: SDP scan failure QProcess::NormalExit 3 –
The issue remains unsolved
**what / where / how to RESOLVEMissing CAP_NET_ADMIN permission.**
My last copy from CURRENT github has same problem.
It does not matted what kit is in use - same problem.I have decided to give QT Bluetooth examples another try.
I have a working btscanner example and it detect both local adapter and remote devices.
It actually identifies remote devices as “paired”.
But it does not do “connect”.My btchat example has code to “connect” , but besides some obvious bugs is DOES NOT
even finds remote devices as btscanner does.I get these errors - coming rom “bluez” library.
Been there before ( use source code for bluez ??) – with same error and still have no idea how to fix it.I could use some help from a person familiar with “bluez”.
At present I am trying to compare btscanner “discover remote devices “ and btchat way to do same .
The obvious is – btchat uses “agent” and I am trying to “step thru “ the agent code.qt.bluetooth.bluez: Missing CAP_NET_ADMIN permission. Cannot determine whether a found address is of random or public type.
qt.bluetooth.bluez: SDP scan failure QProcess::NormalExit 3If I “run” my app second time , I get additional “bluez” errors
**qt.bluetooth.bluez: Cannot register profile "UUID already registered"
SOLVED - terminate debug session ! BEFORE running again **
qt.bluetooth.bluez: Missing CAP_NET_ADMIN permission. Cannot determine whether a found address is of random or public type.
-
Your application executable needs the NET ADMIN capability to do whatever it is you are asking it to do, and does not have it.
$ sudo apt install libcap-ng-utils ... # Inspect capabilities. $ filecap /usr/bin/ping file capabilities /usr/bin/ping net_raw # Most user applications do not have/need anything. # Following is probably the case for you $ filecap /full/path/to/your/executable $ Unable to get capabilities of /full/path/to/your/executable: No data available
It will probably run as root: that is definitely not the correct approach. You can grant the executable the network admin capability:
$ sudo filecap /full/path/to/your/executable net_admin $ filecap /full/path/to/your/executable file capabilities /full/path/to/your/executable net_admin
You will have to do that every time you rebuild it.
-
@ChrisW67 said in Need an assistence with "bluez" libray errors - sort off repost:
our application executable needs the NET ADMIN capability to do whatever it is you are asking it to do, and does not have it.
$ sudo apt install libcap-ng-utils
...Inspect capabilities.
$ filecap /usr/bin/ping
file capabilities
/usr/bin/ping net_rawMost user applications do not have/need anything.
Following is probably the case for you
$ filecap /full/path/to/your/executable
$ Unable to get capabilities of /full/path/to/your/executable: No data availableIt will probably run as root: that is definitely not the correct approach. You can grant the executable the network admin capability:
$ sudo filecap /full/path/to/your/executable net_admin
$ filecap /full/path/to/your/executable
file capabilities
/full/path/to/your/executable net_adminYou will have to do that every time you rebuild it.
THANKS
Unless I did it wrong , I am getting this after install and following the error suggestion
On top of that I get "standard" OS error which I cannot "screen shot". BUT it may be a dupe of the stuff I get in terminal anyway .
I am also posting text of the entire install - just FYI - I may need to delete it later. No need to clutter stuff here .
<pre><font color="#26A269"><b>ov25-1@nov251-desktop</b></font>:<font color="#12488B"><b>~</b></font>$ sudo apt install libcap-ng-utils
[sudo] password for nov25-1:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libflashrom1 libftdi1-2
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
libcap-ng-utils
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 16.2 kB of archives.
After this operation, 84.0 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu jammy/universe amd64 libcap-ng-utils amd64 0.7.9-2.2build3 [16.2 kB]
Fetched 16.2 kB in 1s (21.3 kB/s)<font color="#A2734C"> </font>
Selecting previously unselected package libcap-ng-utils.
(Reading database ... 224780 files and directories currently installed.)
Preparing to unpack .../libcap-ng-utils_0.7.9-2.2build3_amd64.deb ...
Unpacking libcap-ng-utils (0.7.9-2.2build3) ...
Setting up libcap-ng-utils (0.7.9-2.2build3) ...
Processing triggers for man-db (2.10.2-1) ...
<font color="#26A269"><b>nov25-1@nov251-desktop</b></font>:<font color="#12488B"><b>~</b></font>$ #inspect capabilities
<font color="#26A269"><b>nov25-1@nov251-desktop</b></font>:<font color="#12488B"><b>~</b></font>$ inspect capabilities
Command 'inspect' not found, but can be installed with:
sudo apt install libboost1.74-tools-dev
<font color="#26A269"><b>nov25-1@nov251-desktop</b></font>:<font color="#12488B"><b>~</b></font>$ sudo apt install libboost1.74-tools-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libflashrom1 libftdi1-2
Use 'sudo apt autoremove' to remove them.
Suggested packages:
xsltproc doxygen docbook-xsl default-jdk fop
The following NEW packages will be installed:
libboost1.74-tools-dev
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 1,351 kB of archives.
After this operation, 6,775 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 libboost1.74-tools-dev amd64 1.74.0-14ubuntu3 [1,351 kB]
Fetched 1,351 kB in 1s (1,557 kB/s)<font color="#A2734C"> </font>
Selecting previously unselected package libboost1.74-tools-dev.
(Reading database ... 224791 files and directories currently installed.)
Preparing to unpack .../libboost1.74-tools-dev_1.74.0-14ubuntu3_amd64.deb ...
Unpacking libboost1.74-tools-dev (1.74.0-14ubuntu3) ...
Setting up libboost1.74-tools-dev (1.74.0-14ubuntu3) ...
Processing triggers for man-db (2.10.2-1) ...
<font color="#26A269"><b>nov25-1@nov251-desktop</b></font>:<font color="#12488B"><b>~</b></font>$ inspect capabilities
terminate called after throwing an instance of 'boost::filesystem::filesystem_error'
what(): boost::filesystem::canonical: No such file or directory: "/home/nov25-1/capabilities"
Aborted (core dumped)
<font color="#26A269"><b>nov25-1@nov251-desktop</b></font>:<font color="#12488B"><b>~</b></font>$</pre>
-
The line reading:
# Inspect capabilities.
is a comment (by me, deliberately), not a command. It did nothing because that is the appropriate response to a comment.
You did not need to installinspect
and its Boost dependencies, or runinspect
, and hence did not need to see the error message.BTW: The forum does not take HTML fragments for formatting. If you want a large piece of monospaced output paste it between two lines containing only three backticks or just click the "</>" code button in the editor.