Tiny Core Extensions > TCE Bugs

polkitd hardwired to user=tc?

(1/2) > >>

GNUser:
I'm on TCL16 x86_64, tinkering with dbus and polkit to try to understand how it all works.

I use  user=bruno  bootcode and would like  polkitd  to use my home directory, but it insists on using  /home/tc  even though I've changed the user in polkit's config file (/usr/local/etc/dbus-1/system.d/org.freedesktop.PolicyKit1.conf) to "bruno":


--- Code: ---$ cat /proc/cmdline
...user=bruno...

$ whoami
bruno

$ grep user /usr/local/etc/dbus-1/system.d/org.freedesktop.PolicyKit1.conf
  <policy user="bruno">
  <policy user="bruno">

$ sudo /usr/local/lib/polkit-1/polkitd &
Error switching to user tc: Error changing to home directory /home/tc: No such file or directory
Exiting with code 1
--- End code ---

Please, how do I force polkitd to use user "bruno" rather than user "tc"?

Rich:
Hi GNUser
Maybe check:

--- Code: ---/usr/local/share/dbus-1/system.conf
--- End code ---

GNUser:
Hi Rich. No luck--even if all references to user  tc  in  /usr/local/share/dbus-1/system.conf  and  /usr/local/etc/dbus-1/system.d/org.freedesktop.PolicyKit1.conf  are changed to  bruno, polkit still insists on user tc:


--- Code: ---$ grep user /usr/local/share/dbus-1/system.conf
     auth mechanisms, run as a different user, etc. -->
  <!-- Run as special user -->
  <user>bruno</user>
    <!-- All users can connect to system bus -->
    <allow user="*"/>
  <policy user="root">
  <policy user="root">
       enable other privileged users to view statistics and debug info -->
  <policy user="root">
  <!-- <limit name="max_connections_per_user">256</limit> -->

$ sudo /usr/local/etc/init.d/dbus start
starting dbus daemon...

$ ps -ef | grep dbus-daemon
 7667 bruno    dbus-daemon --nofork --print-address 4 --session
24133 bruno    /usr/local/bin/dbus-daemon --system   # note that dbus does honor the user setting in /usr/local/share/dbus-1/system.conf
24200 bruno    grep dbus-daemon

$ sudo /usr/local/lib/polkit-1/polkitd &
Error switching to user tc: Error changing to home directory /home/tc: No such file or directory
Exiting with code 1

--- End code ---

GNUser:
I noticed that in Devuan, polkitd runs as user "polkitd" so maybe the uid doesn't matter very much (i.e., it's all about the rules in /usr/local/share/polkit-1/)?


--- Code: ---Devuan$ ps -ef | grep polkit
polkitd   1349     1  0 12:40 ?        00:00:00 /usr/lib/polkit-1/polkitd --no-debug
--- End code ---

Even if ultimately doesn't matter much, I'm a bit puzzled about polkitd's insistence on running as user tc.

Rich:
Hi GNUser
I did find this:

--- Code: ---tc@box:~$ sudo grep -iR tc /usr/local/share/polkit-1/actions/* | grep -i user
/usr/local/share/polkit-1/actions/org.freedesktop.color.policy:    <annotate key="org.freedesktop.policykit.owner">unix-user:tc</annotate>
/usr/local/share/polkit-1/actions/org.freedesktop.color.policy:    <annotate key="org.freedesktop.policykit.owner">unix-user:tc</annotate>
/usr/local/share/polkit-1/actions/org.freedesktop.color.policy:    <annotate key="org.freedesktop.policykit.owner">unix-user:tc</annotate>
/usr/local/share/polkit-1/actions/org.freedesktop.color.policy:    <annotate key="org.freedesktop.policykit.owner">unix-user:tc</annotate>
/usr/local/share/polkit-1/actions/org.freedesktop.color.policy:    <annotate key="org.freedesktop.policykit.owner">unix-user:tc</annotate>
/usr/local/share/polkit-1/actions/org.freedesktop.color.policy:    <annotate key="org.freedesktop.policykit.owner">unix-user:tc</annotate>
/usr/local/share/polkit-1/actions/org.freedesktop.color.policy:    <annotate key="org.freedesktop.policykit.owner">unix-user:tc</annotate>
/usr/local/share/polkit-1/actions/org.freedesktop.color.policy:    <annotate key="org.freedesktop.policykit.owner">unix-user:tc</annotate>
/usr/local/share/polkit-1/actions/org.freedesktop.color.policy:    <annotate key="org.freedesktop.policykit.owner">unix-user:tc</annotate>
--- End code ---
But that file is not part of the extension. It gets created somehow.

And I know we don't support system.d, but it looks like this might be involved:

--- Code: ---tc@box:~$ sudo grep -iR tc /usr/local/share/dbus-1/system.d/org.freedesktop.ColorManager.conf  | grep -i user
  <!-- Only user root or user tc can own the colord service -->
  <policy user="tc">
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version