Is it possible to change the location for
.Xauthority, to something other than
$HOME/.Xauthority ? AFAIU, this file is being created every time I log into
LXDE, by my login manager
The problem I am having is following:
I want to set my home to "immutable" using extended attributes:
chattr +i /home/martin/
This way, no applications can save their files directly in
/home/martin/, but they can still save files in directories located lower levels of my home, i.e.
At the moment, when I set my home to immutable, I cannot login to
LXDE because the login manager (
slim) cannot create
/home/martin/.Xauthority. This happens even if the old
.Xauthority exists. The login manager could just overwrite the old file with new data, but apparently this is not what it does. It creates a new file and deletes the old one. This is not allowed when /home/martin is immutable (overwriting existing file would be allowed).
Therefore, I would like to store
.Xauthority somewhere else, such as
.config/.Xauthority. Is this possible?
I know that
xauth takes the parameter
-f where file path can be specified.
looking at the source code of slim, I think I might have found the place where
.Xauthority is being deleted and created again:
string xauthority = pw->pw_dir; xauthority.append("/.Xauthority"); ... /* reinitialize auth file */ authfile = cfg->getOption("authfile"); remove(authfile.c_str()); putenv(StrConcat("XAUTHORITY=", authfile.c_str())); Util::add_mcookie(mcookie, ":0", cfg->getOption("xauth_path"), authfile);
How could I change the source code, so that file gets overwritten, rather than deleted/created ?