Missing CAP_NET_ADMIN permission
-
SORT OF SOLVED - posted for info only.
This problem is related to Ubuntu "Bluetooth manager" which by itself is one on the most unreliable application , my opinion, running on Ubuntu. When in for some unknown and I really do not care why and how reason it gets into "'AIRPLANE MODE (!) " Qt "agent discovery " will throw this error.
Most reliable way to get rid of "Airplane mode " is to reboot...I would like to RESOLVE this...
I11:55:26: Starting /home/nov25-1/Qt/Nov26/Examples/Qt-6.5.0/bluetooth/build-btchat-Desktop_Qt_6_5_0_GCC_64bit-Debug/btchat...
qt.bluetooth.bluez: Missing CAP_NET_ADMIN permission. Cannot determine whether a found address is of random or public type.There has been a discussion about it and as is customary it was scudded to "wrong version of QT"
This is an issue using QT example "btchat" which is very buggy and I just cannot keep fixing the bugs in DIFFERENT version of the example .
this is NOT a issue of QT version - there is something missing inn QT implementation of "bluez" library
I need somebody who know more about Linux and QT usage of bluez that I do and help me fix this.
YES - I want to fix it , not just have a pointless discussion about it.
I am hoping that somebody who actually knows / used QT "btchat" example can help to fix it.
And if I asked this before , it does not matter, it is still an issue ...
-
SORT OF SOLVED - posted for info only.
This problem is related to Ubuntu "Bluetooth manager" which by itself is one on the most unreliable application , my opinion, running on Ubuntu. When in for some unknown and I really do not care why and how reason it gets into "'AIRPLANE MODE (!) " Qt "agent discovery " will throw this error.
Most reliable way to get rid of "Airplane mode " is to reboot...I would like to RESOLVE this...
I11:55:26: Starting /home/nov25-1/Qt/Nov26/Examples/Qt-6.5.0/bluetooth/build-btchat-Desktop_Qt_6_5_0_GCC_64bit-Debug/btchat...
qt.bluetooth.bluez: Missing CAP_NET_ADMIN permission. Cannot determine whether a found address is of random or public type.There has been a discussion about it and as is customary it was scudded to "wrong version of QT"
This is an issue using QT example "btchat" which is very buggy and I just cannot keep fixing the bugs in DIFFERENT version of the example .
this is NOT a issue of QT version - there is something missing inn QT implementation of "bluez" library
I need somebody who know more about Linux and QT usage of bluez that I do and help me fix this.
YES - I want to fix it , not just have a pointless discussion about it.
I am hoping that somebody who actually knows / used QT "btchat" example can help to fix it.
And if I asked this before , it does not matter, it is still an issue ...
@AnneRanch
Execute [if you haven't gotsetpcapyou might needsudo apt-get install libcap2-bin]:sudo setpcap CAP_NET_ADMIN=eip /path/to/your/executableDo this after you have built it. Then run (without rebuilding), does the error go away? If so it needs rerunning each time you produce the executable again.
-
@AnneRanch
Execute [if you haven't gotsetpcapyou might needsudo apt-get install libcap2-bin]:sudo setpcap CAP_NET_ADMIN=eip /path/to/your/executableDo this after you have built it. Then run (without rebuilding), does the error go away? If so it needs rerunning each time you produce the executable again.
@JonB SUCCESS
( minor typo in tour post...)
Got rid of the error , now working on why btchat is not detecting remote devices....
-
@AnneRanch
Execute [if you haven't gotsetpcapyou might needsudo apt-get install libcap2-bin]:sudo setpcap CAP_NET_ADMIN=eip /path/to/your/executableDo this after you have built it. Then run (without rebuilding), does the error go away? If so it needs rerunning each time you produce the executable again.
@JonB OK, now for $64 hiw to make this permanent... I guess that is a question for Linux experts.
-
@JonB OK, now for $64 hiw to make this permanent... I guess that is a question for Linux experts.
@AnneRanch
You could useQMAKE_POST_LINKentry in the.profile to add the necessary command, to be rerun immediately after every time you link to remake the executable file.Alternatively read https://forum.qt.io/topic/114503/missing-cap_net_admin-permission and try to get @sierdzio's edits to
/etc/dbus-1/system.d/bluetooth.confworking for you. If that's appropriate to your situation, I know nothing about what "dbus" is. -
@AnneRanch said in Missing CAP_NET_ADMIN permission:
I would like to RESOLVE this...
You've asked this before. It has been answered before. Here we are again.
https://forum.qt.io/topic/141258/need-an-assistence-with-bluez-libray-errors-sort-off-repost/2@JonB has an alternate version of the same thing.
-
@AnneRanch
You could useQMAKE_POST_LINKentry in the.profile to add the necessary command, to be rerun immediately after every time you link to remake the executable file.Alternatively read https://forum.qt.io/topic/114503/missing-cap_net_admin-permission and try to get @sierdzio's edits to
/etc/dbus-1/system.d/bluetooth.confworking for you. If that's appropriate to your situation, I know nothing about what "dbus" is.@JonB Making progress :automating the setcap CAP_NET_ADMIN process
Now I need to figure out how to add this "pass helper" to the .pro file .
Any idea ?Added this to .pro and it partially works
QMAKE_POST_LINK += $ sudo setcap CAP_NET_ADMIN=eip /home/nov25-1/Qt/Nov26/Examples/Qt-5.15.2/bluetooth/build-btchat-Desktop_Qt_5_15_2_GCC_64bit-Debug/btchat q
getting this response
sudo setcap CAP_NET_ADMIN=eip /home/nov25-1/Qt/Nov26/Examples/Qt-5.15.2/bluetooth/build-btchat-Desktop_Qt_5_15_2_GCC_64bit-Debug/btchat q
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required
make: *** [Makefile:303: btchat] Error 1so how to tell make to use password after the QMAKE_POST_LINK ?
Adding another QMAKE_POST_LINK += q did not work ,,,,
-
@JonB Making progress :automating the setcap CAP_NET_ADMIN process
Now I need to figure out how to add this "pass helper" to the .pro file .
Any idea ?Added this to .pro and it partially works
QMAKE_POST_LINK += $ sudo setcap CAP_NET_ADMIN=eip /home/nov25-1/Qt/Nov26/Examples/Qt-5.15.2/bluetooth/build-btchat-Desktop_Qt_5_15_2_GCC_64bit-Debug/btchat q
getting this response
sudo setcap CAP_NET_ADMIN=eip /home/nov25-1/Qt/Nov26/Examples/Qt-5.15.2/bluetooth/build-btchat-Desktop_Qt_5_15_2_GCC_64bit-Debug/btchat q
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required
make: *** [Makefile:303: btchat] Error 1so how to tell make to use password after the QMAKE_POST_LINK ?
Adding another QMAKE_POST_LINK += q did not work ,,,,
@AnneRanch said in Missing CAP_NET_ADMIN permission:
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
If you require a password for your
sudothen you have to follow one of these two routes to supply it. Details inman sudo. This would apply to any command you attempt to run viasudofrom any program instead of typing it into a shell when you can be prompted for the password.