Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QSharedMemory root access problem in ubuntu-20



  • 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



  • 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



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