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. QSharedMemory root access problem in ubuntu-20
QtWS25 Last Chance

QSharedMemory root access problem in ubuntu-20

Scheduled Pinned Locked Moved Unsolved General and Desktop
qsharedmemoryubuntu 20.04root permission
3 Posts 3 Posters 418 Views
  • 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.
  • S Offline
    S Offline
    Sina Ranjkesh zade
    wrote on 5 Oct 2021, 16:26 last edited by Sina Ranjkesh zade 10 May 2021, 16:27
    #1

    Hi,
    Recently I've upgraded my ubuntu from 18.04 to 20.04. Before this, I could run my code which uses QSharedMemory and QProcess libraries to create a process and talk with it without any problem.
    But it seems the sharing memory permission changed only to root level in ubuntu 20.
    Is there any way to run Qt with user permission (not root permission) and solve this problem?
    Actually, I'm looking for a way to give user sharing memory permissions but as I searched, all said how to create shared memory by "shmget" in cpp.
    (I prefer to give user sharing memory permission because I share memory in my process too which is python code. So if I could give this permission, this problem will be solved completely)
    Any help would be greatly appreciated
    Best,
    Sina

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mchinand
      wrote on 5 Oct 2021, 18:10 last edited by
      #2

      You can try what is mentioned in this post (sudo/root permission is required to run the mentioned command once). https://askubuntu.com/a/1325443

      1 Reply Last reply
      0
      • C Offline
        C Offline
        ChrisW67
        wrote on 7 Oct 2021, 03:50 last edited by
        #3

        I suspect that a combination of CAP_IPC_LOCK and/or CAP_IPC_OWNER capabilities applied to the executable will probably help.
        See setcap man page.

        1 Reply Last reply
        2

        1/3

        5 Oct 2021, 16:26

        • Login

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