LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Reply
  Search this Thread
Old 08-31-2021, 02:25 AM   #1
DeanAnderson
LQ Newbie
 
Registered: Nov 2019
Posts: 19

Rep: Reputation: Disabled
how to allow non-root user to send message to systemd?


Hi
My app run as non root user. And it fails on:
Code:
sd_bus_call_method(
              bus,
              "org.freedesktop.login1",
              "/org/freedesktop/login1",
               "org.freedesktop.login1.Manager",
because of lack of permissions. I prepared file:
Code:
<!DOCTYPE busconfig PUBLIC
          "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
          "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
  <policy user="terko">
    <allow send_destination="org.freedesktop.login1"
           send_interface="org.freedesktop.login1.Manager" />
    <allow send_destination="org.freedesktop.systemd1"
           send_interface="org.freedesktop.systemd1.Manager" />
    <allow send_destination="org.freedesktop.systemd1"
           send_interface="org.freedesktop.DBus.Properties" />
    <allow send_destination="org.freedesktop.login1"
           send_interface="*" />
    <allow send_destination="org.freedesktop.systemd1"
           send_interface="*" />
  </policy>
</busconfig>
and I placed it in terko-dbus.conf file /etc/dbus-1/system.d/ (I tried also /usr/share/dbus-1/system.d) in linux image with the aid of yocto bitbake but still issue occurs. What is lack in my config file? I placed also:
Code:
      <policy context="default">
    <allow own="*"/>
    <allow send_type="method_call"/>
  </policy>
as in system.conf by default it is deny:
Code:
<policy context="default">
    <!-- All users can connect to system bus -->
    <allow user="*"/>

    <!-- Holes must be punched in service configuration files for
         name ownership and sending method calls -->
    <deny own="*"/>
    <deny send_type="method_call"/>
...
however it didn't help. Any ideas?

Last edited by DeanAnderson; 08-31-2021 at 03:28 AM.
 
Old 09-02-2021, 12:22 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
There simply isn't enough context here to even ask for details - I don't know what to ask for.
Unless someone happens to drop in who recognizes this mystery app, and what exactly you are trying to achieve there, I suggest you read the first two non-covid links in my signature, then try again.
Thank You.
Quote:
Originally Posted by DeanAnderson View Post
Hi
My app run as non root user. And it fails on:
Code:
sd_bus_call_method(
              bus,
              "org.freedesktop.login1",
              "/org/freedesktop/login1",
               "org.freedesktop.login1.Manager",
because of lack of permissions. I prepared file:
Code:
<!DOCTYPE busconfig PUBLIC
          "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
          "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
  <policy user="terko">
    <allow send_destination="org.freedesktop.login1"
           send_interface="org.freedesktop.login1.Manager" />
    <allow send_destination="org.freedesktop.systemd1"
           send_interface="org.freedesktop.systemd1.Manager" />
    <allow send_destination="org.freedesktop.systemd1"
           send_interface="org.freedesktop.DBus.Properties" />
    <allow send_destination="org.freedesktop.login1"
           send_interface="*" />
    <allow send_destination="org.freedesktop.systemd1"
           send_interface="*" />
  </policy>
</busconfig>
and I placed it in terko-dbus.conf file /etc/dbus-1/system.d/ (I tried also /usr/share/dbus-1/system.d) in linux image with the aid of yocto bitbake but still issue occurs. What is lack in my config file? I placed also:
Code:
      <policy context="default">
    <allow own="*"/>
    <allow send_type="method_call"/>
  </policy>
as in system.conf by default it is deny:
Code:
<policy context="default">
    <!-- All users can connect to system bus -->
    <allow user="*"/>

    <!-- Holes must be punched in service configuration files for
         name ownership and sending method calls -->
    <deny own="*"/>
    <deny send_type="method_call"/>
...
however it didn't help. Any ideas?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a systemd service as a non-root user taylorkh Linux - General 12 07-02-2021 02:20 PM
I can send email only with root, but not with non-root user james000 Linux - Server 2 04-13-2020 08:15 PM
Does SELinux allow Non-root user bind to port <1024 suddenlyalice Linux - Security 4 10-26-2010 04:59 AM
[SOLVED] How to allow access to some commands having root privleges to be run bu non root user suryashikha Linux - Newbie 8 10-31-2009 01:05 PM
allow non-root user to start gdm kc8tbe Linux - General 5 10-21-2003 09:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 12:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration