切换到系统级别的DBus,要求使用root用户启动ExtBoardD

This commit is contained in:
HEYAHONG 2024-05-07 12:44:09 +08:00
parent fcfb330fde
commit aa03cdb77f
No known key found for this signature in database
GPG Key ID: 97E3E469FE2C920B
2 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,15 @@
<busconfig>
<!-- ../system.conf have denied everything, so we just punch some holes -->
<policy user="root">
<allow own="ExtBoard.Deamon.Server"/>
<allow send_destination="ExtBoard.Deamon.Server"/>
<allow send_interface="ExtBoard.Deamon"/>
</policy>
<policy context="default">
<allow send_destination="ExtBoard.Deamon.Server"/>
</policy>
</busconfig>

View File

@ -28,7 +28,7 @@ void DbusInterface_Init()
dispatcher=DBus::StandaloneDispatcher::create();
if(dispatcher != nullptr)
{
con=dispatcher->create_connection(DBus::BusType::SESSION);
con=dispatcher->create_connection(DBus::BusType::SYSTEM);
}
if(con == nullptr)