Fixed custom wallpaper being not respected by sddm.
Review Request #126524 - Created Dec. 26, 2015 and submitted
For some reason sddm cannot handle absolute file paths to wallpapers
and also needs the wallpaper to be readable by others.
This is fixed by copying the wallpaper to the root directory of the
On save the sddmauthhelper copies the background from the absolute path
into the theme directory and sets the "background" key of the
theme.user.conf to the copied file. If previously a different background was
set it is removed beforehand.
Copies and removes backgrounds as intended.
The wallpaper is shown in sddm.
I don't like how we write into /usr/ I know the conf.user does already, but it's an incredibly broken concept on the SDDM side that should get fixed at some point. We should write to /var/ somewhere I think That's a task for another day.
Ideally we should check the calling user can read this file, as you technically have a security bug.
Otherwise I could just select /etc/shadow as my background and suddenly it's available world readable.
A distro/admin could theoretically set polkit up to allow any users to change the SDDM wallpaper. though TBH it'd never happen.
Polkit-Qt has that information available. KAuth does not seem to publicly.
the file could have changed regardless of whether the name has, like if I edit it in krita or something.
Unless you want to compare mtimes, you may as well just copy it everytime.