Introduce a new "early autologin" path that starts the session without
starting the display server first. This avoids starting a rootful X just
to then ignore it and start a Wayland session in a separate VT.
utmps library can be used to provide utmp functionality on systems whose
libcs do not implement it, e.g. musl.
For more details, see https://skarnet.org/software/utmps/.
Signed-off-by: Peter Shkenev <petershh@disroot.org>
PAM modules are distribution specific and are ultimately better fit in
the distribution packaging.
Having them in SDDM brings extra burden to the already stretched
developers and maintainers. Plus a handful of distributions currently
patch the (Arch) PAM modules, where having the full set in their own
tree would make for cleaner solution.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Having a per-distribution set in the upstream project (sddm) does not
scale well. Instead sddm can provide a default set that distributions
can opt out of with "cmake -DINSTALL_PAM_CONFIGURATION=off ..."
Having a per-distribution set in the upstream project (sddm) does not
scale well. Instead sddm can provide a default set that distributions
can opt out of with "cmake -DINSTALL_PAM_CONFIGURATION=off ..."
Glancing through the FreeBSD ports - all the pam modules are patched
already, so dropping them from here should reduce maintenance on both
sides.
Fixes following warnings:
```
QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
Parameter "event" is not declared. Injection of parameters into signal handlers is deprecated. Use JavaScript functions with formal parameters instead.
```
It's not recommended[^1] to use Behaviors with States, but the specific
examples in SDDM weren't causing any problems previously (on Qt5).
Now, with Qt6 support, we can finally observe the promised bugs from the
referenced article in the wild:
* ComboBox can be closed only once. On a second activation it stays open
* Button color transitions on focus out are abruptly stopped on a wrong
color
* ... (this is where I noticed a pattern and decided to convert
everything else preemptively).
This commit essentially reverts 930fa07bf2
[^1]: https://doc.qt.io/qt-5/qtquick-statesanimations-behaviors.html
Qt6 no longer resolves relative URLs on assignment to a property of type
url[^1]. The resolution now happens late, in the context of the item that
uses the URL. In our case, it would be a QML component containing Image.
However, the themes shipped with SDDM contain resources in the theme
directories and rely on the previous algorithm of the URL resolution.
The only documented[^2] way to address that is to resolve the paths in
advance with `Qt.resolvedUrl` to avoid any ambiguity. `Qt.resolvedUrl`
is supported in Qt5, so that should be a safe, albeit a bit verbose,
conversion.
Fixes following error:
```
file:///usr/lib64/qt6/qml/SddmComponents/ComboBox.qml:105:9: QML Image: Cannot open: file:///usr/lib64/qt6/qml/SddmComponents/angle-down.png
```
[^1]: https://doc.qt.io/qt-6/qml-url.html
[^2]: `QQmlAbstractUrlInterceptor` exists in Qt5, but
`QQmlEngine::setUrlInterceptor` is undocumented and has potential
negative side-effects. It also receives already resolved absolute URLs.
8c370d9 already cleared the list of layouts, but Num/Caps indicators
are also not supported on Wayland. Let's communicate that clearly by
marking the KeyboardModel as disabled.
metadata.desktop in the theme directory has a new key "QtVersion" which
defaults to 5. If it's not 5, sddm-greeter-qt${QtVersion} will be used to
show the theme.
liri-project/qmllint silently switched to Qt 6 and the status output is also
broken.
Pin it to a specific hash and maybe fix the output by setting the env only
for that job.
Starting from sddm 0.20 (by https://github.com/sddm/sddm/pull/1230),
the xauth file is at `/tmp/xauth_*` instead of `~/.Xauthority`.
The new location is subject to systemd-tmpfiles's cleanup, which
deletes files from /tmp/ that are older than 10 days:
https://github.com/systemd/systemd/blob/v254/tmpfiles.d/tmp.conf
The xauth file should not be removed while the session is active,
because it is needed for starting X applications. When removed,
X applications won't start any more.
This patch fixes the issue by declaring these files as "ignored"
in sddm-tmpfiles.conf, so that systemd-tmpfiles doesn't remove them.
Minimal test case:
```
touch /tmp/xauth_testonly
SYSTEMD_LOG_LEVEL=debug systemd-tmpfiles --prefix=/tmp/ --clean
```
Pre-patch output:
File "/tmp/xauth_testonly": change time Mon 2023-10-02 01:27:38.395466 CEST is too new.
(meaning that the file was considered for removal)
Post-patch output:
Ignoring "/tmp/xauth_testonly": a separate glob exists.
(meaning that the file is ignored and not considered for removal)
There may be a case when pam authentication error not only of the `auth` type, but also, for example, of the `session` type fall into the `slotAuthError` during autologin. For example, a pam module error in the file `/etc/pam.d/postlogin` already during the loaded session. As a result, a fallback (`handleAutologinFailure`) is triggered that loads greeter (sddm-theme) already on top of the loaded session, which leads to unpleasant consequences.
In my opinion, this is incorrect, and I think it's worth transferring the fallback to the `slotAuthenticationFinished` method and calling fallback if `success` = false, then the fallback will trigger exactly when an error of the `auth` type occurred, i.e. when the session really wasn't loaded and the greeter should be loaded to avoid black screen with only cursor.
ECM was added by 6ef91b0b because of some potential dependency needed for
Wayland, which was not added until now.
The commit also changed the "uninstall" target to not be created if
ECM >= 1.7.0. ECM itself doesn't register an uninstall target automatically
either, which means this is dead code. Just remove it.
If the autologin auth attempt failed for any reason, then start socket server and greeter (launch sddm theme, like as if there was no autologin at all).
From https://bugs.debian.org/1006631:
> dbus supports policy files in both `/usr/share/dbus-1/system.d` and
> `/etc/dbus-1/systemd`. [The] recently released dbus 1.14.0, officially
> deprecates installing packages' default policies into `/etc/dbus-1/systemd`,
> instead reserving it for the sysadmin. This is the same idea as the
> difference between `/usr/lib/udev/rules.d` and `/etc/udev/rules.d`.