Re: timedate1 permissions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mantas,

That was the advice that I needed.

I modified our Yocto build to include polkit, added datetime group to our user and now it’s working.

 

Thanks,

Greg

 

From: Mantas Mikulėnas <grawity@xxxxxxxxx>
Sent: Wednesday, February 17, 2021 10:56 AM
To: Greg Wilson-Lindberg <GWilson@xxxxxxxxxxxx>
Cc: systemd-devel@xxxxxxxxxxxxxxxxxxxxx
Subject: Re: [systemd-devel] timedate1 permissions

 

Systemd D-Bus services use polkit for authorization when the message is sent by someone not uid 0. Depending on which version you have, you can write a .pkla file (Debian) or a _javascript_ function (other distros) that allows a specific action for a specific user or group.

 

You'll want to allow the "org.freedesktop.timedate1.set-timezone" action (see `pkaction`). Recent versions have some documentation in `man 8 polkit`.

 

If the system doesn't have polkit installed, then all you have is the hardcoded "uid == 0" check. (Polkit *is* the configuration facility for that.)

 

 

On Wed, Feb 17, 2021 at 8:18 PM Greg Wilson-Lindberg <GWilson@xxxxxxxxxxxx> wrote:

First, I hope that I have found the proper list for this question, if not I'm sorry to bother you all.

I'm trying to run a program that changes the timezone. Our application is using the dbus facility to change the time zone. It works when run as root but fails when run as our user. I had thought initially that the problem was with dbus permissions but have since found out that the fact that the messages are going over the dbus means that the dbus permissions are set correctly.

So, it seems that the systemd.timedate1 utility has it's own permissions that is rejecting our request to change the timezone. My question at this point becomes, how do I change the permissions for the system.timedate1 utility to allow my non-root user to change the time and timezone?

Regards,
Greg Wilson-Lindberg
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


 

--

Mantas Mikulėnas

_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux