<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi Mantas,<o:p></o:p></p>
<p class="MsoNormal">That was the advice that I needed.<o:p></o:p></p>
<p class="MsoNormal">I modified our Yocto build to include polkit, added datetime group to our user and now it’s working.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Greg<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Mantas Mikulėnas <grawity@gmail.com> <br>
<b>Sent:</b> Wednesday, February 17, 2021 10:56 AM<br>
<b>To:</b> Greg Wilson-Lindberg <GWilson@sakuraus.com><br>
<b>Cc:</b> systemd-devel@lists.freedesktop.org<br>
<b>Subject:</b> Re: [systemd-devel] timedate1 permissions<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">You'll want to allow the "org.freedesktop.timedate1.set-timezone" action (see `pkaction`). Recent versions have some documentation in `man 8 polkit`.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.)<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Wed, Feb 17, 2021 at 8:18 PM Greg Wilson-Lindberg <<a href="mailto:GWilson@sakuraus.com">GWilson@sakuraus.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">First, I hope that I have found the proper list for this question, if not I'm sorry to bother you all.<br>
<br>
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.<br>
<br>
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?<br>
<br>
Regards,<br>
Greg Wilson-Lindberg<br>
_______________________________________________<br>
systemd-devel mailing list<br>
<a href="mailto:systemd-devel@lists.freedesktop.org" target="_blank">systemd-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/systemd-devel" target="_blank">https://lists.freedesktop.org/mailman/listinfo/systemd-devel</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">Mantas Mikulėnas<o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>