Re: Update .Xauthority on hostnamed change

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

 





On Thu, Aug 22, 2019 at 3:50 PM Igor Chudov <nir@xxxxxxxxxxxx> wrote:
Hello!

I want to update user's .Xauthority file with cookies targeted at new hostname on hostname change via hostnamectl. I need an advice about the best possible approach for solving this problem. I tried to investigate several possible approaches:

- Add xauth functions to systemd-hostnamed (or hostnamectl). This approach will require linking with Xorg libraries and efforts to maintain patch aside from mainstream;
- Implement separate systemd service which is activated on request to D-Bus interface org.freedesktop.hostname1 . The problem is that I will need to know if systemd-hostnamed changed hostname correctly somehow and will also need to know previous hostname;
- Implement separate application listening D-Bus for PropertiesChanged signal and somehow verify if required property changed.

So... Is there any other (more sane) way to solve a problem? Maybe it is possible to create a hook for hostnamed?

Add an xhost entry "SI:localuser:$USER" or "SI:localuser:#$UID" from your xserver startup script. This will tell Xorg to accept all connections from its owner based on UID, removing the need for Xauthority in the first place. (Several display managers already do this.)

Note that programs can use poll() on /proc/sys/kernel/hostname to know about hostname updates independently from systemd-hostnamed.

--
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