Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Missing CAP_NET_ADMIN permission

Missing CAP_NET_ADMIN permission

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 3 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by Anonymous_Banned275
    #1

    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 ...

    JonBJ 1 Reply Last reply
    0
    • A Anonymous_Banned275

      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 ...

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @AnneRanch
      Execute [if you haven't got setpcap you might need sudo apt-get install libcap2-bin]:

      sudo setpcap CAP_NET_ADMIN=eip /path/to/your/executable
      

      Do 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.

      A 2 Replies Last reply
      0
      • JonBJ JonB

        @AnneRanch
        Execute [if you haven't got setpcap you might need sudo apt-get install libcap2-bin]:

        sudo setpcap CAP_NET_ADMIN=eip /path/to/your/executable
        

        Do 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.

        A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #3

        @JonB SUCCESS
        ( minor typo in tour post...)

        f6234adc-2e18-44ad-9a11-3e5e739249ca-image.png

        Got rid of the error , now working on why btchat is not detecting remote devices....

        1 Reply Last reply
        0
        • JonBJ JonB

          @AnneRanch
          Execute [if you haven't got setpcap you might need sudo apt-get install libcap2-bin]:

          sudo setpcap CAP_NET_ADMIN=eip /path/to/your/executable
          

          Do 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.

          A Offline
          A Offline
          Anonymous_Banned275
          wrote on last edited by
          #4

          @JonB OK, now for $64 hiw to make this permanent... I guess that is a question for Linux experts.

          JonBJ 1 Reply Last reply
          0
          • A Anonymous_Banned275

            @JonB OK, now for $64 hiw to make this permanent... I guess that is a question for Linux experts.

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #5

            @AnneRanch
            You could use QMAKE_POST_LINK entry in the .pro file 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.conf working for you. If that's appropriate to your situation, I know nothing about what "dbus" is.

            A 1 Reply Last reply
            0
            • C Offline
              C Offline
              ChrisW67
              wrote on last edited by ChrisW67
              #6

              @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.

              1 Reply Last reply
              1
              • JonBJ JonB

                @AnneRanch
                You could use QMAKE_POST_LINK entry in the .pro file 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.conf working for you. If that's appropriate to your situation, I know nothing about what "dbus" is.

                A Offline
                A Offline
                Anonymous_Banned275
                wrote on last edited by
                #7

                @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 1

                so how to tell make to use password after the QMAKE_POST_LINK ?

                Adding another QMAKE_POST_LINK += q did not work ,,,,

                JonBJ 1 Reply Last reply
                0
                • A Anonymous_Banned275

                  @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 1

                  so how to tell make to use password after the QMAKE_POST_LINK ?

                  Adding another QMAKE_POST_LINK += q did not work ,,,,

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by JonB
                  #8

                  @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 sudo then you have to follow one of these two routes to supply it. Details in man sudo. This would apply to any command you attempt to run via sudo from any program instead of typing it into a shell when you can be prompted for the password.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved