Skip to content

Commit

Permalink
Bring up-to-date (#1)
Browse files Browse the repository at this point in the history
* Add some messages to PAM close session

* Specify arguments of SessionCommand in manpage

* Improve SessionCommand man

* helper: Delete credentials after closing the session

The credentials should be deleted after the session has
been closed with pam_close_session.

* Fix loading the embedded theme and error reporting

We now handle correctly the following situations:

- Empty theme in the settings: fallback to the embedded theme.
- Selected theme doesn't exist: load the first one in alphabetical order like
  before, in addition to that fallback to the embedded theme if there are no
  themes at all.
- Selected theme has QML errors: fallback to the embedded theme and display
  the errors prompting the user to select another one.

This means that in any case we always let the user log in with a theme
embedded into the executable in order to be sure it always exist.

Closes: sddm#551
Closes: sddm#632

* Do not recreated ThemeMetadata and ThemeConfig

Just reload the configuration.

* Update maldives screenshot

Closes sddm#585

* Clean password when authentication fails

Closes sddm#320

* Add Indian flag (sddm#678)

Scaled from an SVG created exclusively for the purpose.

Signed-off-by: Sanjeev Premi <spremi@ymail.com>

* Update ChangeLog

* Mention "maui" in the ChangeLog

* Use embedded theme when the configured one doesn't exist

Using the first alphabetical theme is confusing because it is
just random for the user, fallback to the embedded theme instead.

* Bump version to 0.14.0

* Fix display of user avatars. (sddm#684)

QFile::exists("...") does not understand file:// URLs, at least in Qt
5.7.0 and Qt 4.8.7.

* Remove quotes from ServerArguments (sddm#696)

Remove quotes from ServerArguments since it goes directly in the command line:
Running: /usr/bin/X "-nolisten tcp -dpi 192" -auth /var/run/sddm/{...}  -background none -noreset -displayfd 21 vt1

* Add a config option to enable high-DPI scaling (sddm#701)

The new EnableHiDPI boolean option permits to enable or not the
activation of Qt::AA_EnableHighDpiScaling attribute.

The default is enabled.

[ChangeLog][Greeter] Enable Qt's automatic high dpi scaling based on
configuration

Signed-off-by: Stany MARCEL <stanypub@gmail.com>

* Make the default cursor themed (sddm#705)

The X root window uses an "X" as the default cursor. To use a themed one,
it has to be set explicitly, e.g. by QML MouseAreas. For themes which do
not have a MouseArea that spans the entire screen, the "X" cursor would
be visible. By setting a cursor in the root QML object, the themed cursor
will be used by default. (https://bugs.kde.org/show_bug.cgi?id=337083)

[ChangeLog][Greeter] Fix default cursor appearance

* elarun: Update date and time

[ChangeLog][Themes] Update date and time in the "elarun" theme

Closes: sddm#665

* Add Hindi translations (sddm#706)


[ChangeLog][Translations] Add Hindi

Signed-off-by: Sanjeev Premi <spremi@ymail.com>

* Completed translation to Swedish (sddm#709)


[ChangeLog][Translations] Complete Swedish

Signed-off-by: Kristoffer Grundström <hamnisdude@gmail.com>

* Support Non-Latin characters in theme settings (sddm#708)

By default, QSettings doesn't support non-lating characters in config file.
However, KCM will write background path into theme config file without escape.
That means, we need to read UTF-8 strings.

[ChangeLog][Themes] Support UTF-8 in theme configuration

* Update fr.ts (sddm#710)

A better translation for the term "Layout" which corresponds in this
context to "keyboard".

Le "Layout" dans ce contexte correspond à la disposition du clavier.
Ce terme me semble plus parlant que "Configuration" qui est très général.

[ChangeLog][Translations] Improved French translation

* add fish shell specific commands to Xsession and wayland-session
to get the fish-specific login environment instead of the catchall /etc/profile environment.

* Unlock Gnome keyring on login (sddm#711)

Gnome's keyring stores user keys (eg: wifi passwords) encrypted, and uses
a pam module to unlock them at login.

This patch adds `optional` support for the gnome_keyring pam module, so
Gnome can be launched successfully from SDDM. Without this, Gnome will
ask for the users password again after logging in, the first time it needs
to access the keyring, in order to unlock it.

Other display managers as the Gnome Display Manger [1], LightDM [2] and
Enlightment's Entrance [3] already do this.

[1] https://github.com/GNOME/gdm/blob/master/data/pam-arch/gdm-password.pam
[2] http://bazaar.launchpad.net/~lightdm-team/lightdm/trunk/view/head:/debian/lightdm.pam
[3] https://git.enlightenment.org/misc/entrance.git/tree/data/entrance

[ChangeLog][Pam] Unlock GNOME keyring on login

* releng: Update create_changelog.pl

* releng: Fix Perl errors

* releng: Support GitHub issue references

* Fix manual for Current theme setting

* add kwallet5 support

Add kwallet-pam support for the plasma5 desktop

* Implemented kwallet5 for autologon as well

Note: It is only working with an empty kwallet password.

* Failure log messages if gnome keyring is not installed.

If gnome keyring is not installed pam will log an error in the system log.  In order to supress the message a dash in front of the entry is required.

* Cleanup dangling pointer in SocketServer (sddm#725)

This fixes SDDM crashing if xorg fails to load

[ChangeLog][Auth] Fix crash if Xorg fails to load

* Fix all incorrect use of QStringLiteral

* Fix QStringLiteral

* autologin: try last successful session if no autologin session is set

* By this the user can decide which session to select for autologin without
  touching priviledged configuration file.
* If session is set in configuration, the behaviour is same as before

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>

* Don’t install themes Main.qml/metadata.desktop twice, in some conditions they don’t get configured

* Add danish (da) translation (sddm#766)

* Simple theme 'maya' (sddm#717)

Add Maya theme

Signed-off-by: Sanjeev Premi <spremi@ymail.com>

* Update mailmap

* Install maya theme

* ThemeComponents: Make 'enabled'-property of Button functional

This commit makes it possible to actually disable Buttons.
Previously they were only displayed as disabled but could still be
triggered.

Signed-off-by: Thomas Preisner <thomas.preisner@fau.de>
Signed-off-by: Milan Stephan <milan.stephan@fau.de>

* Also set QT_IM_MODULE in non testing mode

QT_IM_MODULE is set from a config value, however it currently is only
set in testing mode

* Load configuration information from config directories

Our configuration generally consists of user set config options and
distro defined options.

For example, a distro might want to specify a custom theme, but the
user's autostart name can't come from the distro.

Using the same config file leads to problems when upgrading.

This loads configuration from all files in a directory
(/etc/sddm/conf.d) as well as the main config file /etc/sddm.conf
The latter has priority and all writes occur in that file.

* Move EnableHiDPI setting to X11 and Wayland sections

Let's have a different setting depending on the display server.

On Wayland we might have a chance to circumvent bad physical size reported
by some screen while on X11 it's harder because we cannot do that from
QPA, hence a user might want to disable HiDPI on X11 and enable it on
Wayland.

* Document EnableHiDPI setting

* sddm-helper: x11: fix unsupported number of arguements error for unity session

Currently AFAICT the /etc/X11/Xsession script in Ubuntu is expecting 1 and only 1 arguments as the running command, as showed as the following fraction of /etc/X11/Xsession.d/20x11-common_process-args:

```sh
case $# in
  0)
    # No arguments given; use default behavior.
    ;;
  1)
    # One argument given; see what it was.
    case "$1" in
      failsafe)
        # Failsafe session was requested.
        if has_option allow-failsafe; then
          if [ -e /usr/bin/x-terminal-emulator ]; then
            if [ -x /usr/bin/x-terminal-emulator ]; then
              exec x-terminal-emulator -geometry +1+1
            else
              # fatal error
              errormsg "unable to launch failsafe X session ---" \
                       "x-terminal-emulator not executable; aborting."
            fi
          else
            # fatal error
            errormsg "unable to launch failsafe X session ---" \
                     "x-terminal-emulator not found; aborting."
          fi
        fi
        ;;
      default)
        # Default behavior was requested.
        ;;
      *)
        # Specific program was requested.
        STARTUP_FULL_PATH=$(/usr/bin/which "${1%% *}" || true)
        if [ -n "$STARTUP_FULL_PATH" ] && [ -e "$STARTUP_FULL_PATH" ]; then
          if [ -x "$STARTUP_FULL_PATH" ]; then
            STARTUP="$1"
          else
            message "unable to launch \"$1\" X session ---" \
                    "\"$1\" not executable; falling back to default session."
          fi
        else
          message "unable to launch \"$1\" X session ---" \
                  "\"$1\" not found; falling back to default session."
        fi
        ;;
    esac
    ;;
  *)
    # More than one argument given; we don't know what to do.
    message "unsupported number of arguments ($#); falling back to default" \
            "session."
    ;;
esac
```

Currently SDDM runs the Xsession script without quoting the second argument, which causes all xsessions that Exec key contains command-line arguments(like Unity(gnome-session --session=ubuntu)) causes Xsession to bail out with message "Xsession: unsupported number of arguments (2); falling back to default session."

This patch fixes the issue by quoting the %2 argument in the SessionCommand.

Signed-off-by: 林博仁 <Buo.Ren.Lin@gmail.com>

* Parse desktop file sections

Some desktop files have multiple sections, but for now we're only
interested in [Desktop Entry]. Without this patch, every entry was seen
as part of the [Desktop Entry] session, resulting in values getting
overwritten.

* Ignore session desktop files with the Hidden property set to true

They are still read in the autologin case.

Fixes issue sddm#820

* updated Polish translation

Signed-off-by: Marcin Mikołajczak <me@m4sk.in>

* Support elogind as an alterantive session tracker for systemd-logind.

For users who do not want to run the full systemd suite, but do not
want to patch sddm to use ck-launch-session either, elogind can be
used as an alternative session tracker via its PAM module.

* Fix session selection in Elarun

* UserModel: Check for duplicates from getpwent()

* Corrections in Lithuanian language

Corrected some words.

* Include errno.h and string.h where needed.

Do not rely on them being implicitly included by other headers; include
errno.h and string.h whenever errno and strerror(3) are used.

* Also theme the default cursor for the root window

The root window is still accessible in some cases, like context menu overlays.

* Load config from /usr/lib/sddm/sddm.conf.d before /etc/sddm/sddm.conf.d

* Add LIBXCB_INCLUDE_DIR to the list of include directories.

The daemon and the greeter include xcb/xcb.h, but they were relying on xcb's
include directory being implicitly added by the compiler instead of making
sure it was always passed to the compiler.

* Improve Catalan translation

* Wipe the config before creating an example one

* Improve Catalan translation

* Fix format of uk.ts

Fixes sddm#765

* Utilize all the included translations

Fixes sddm#778

* Do not truncate XAUTHORITY file on login

xauth gets used to edit the file, so do not truncate the file with
QIODevice::WriteOnly before.

* Include <unistd.h> for crypt(3), not <crypt.h>

<crypt.h> is part of glibc and other libc implementations, and not available
on systems such as FreeBSD.

We can just drop the include and use <unistd.h> instead, which is the header
POSIX specifies that defines crypt(3).

* Added possibility to change color of dropdown menu.

* Changed menuColor of ComboBoxes.

* Bump version to 0.15.0

* Update changelog

* elarun: Update date and time

[ChangeLog][Themes] Update date and time in the "elarun" theme

Closes: sddm#665

* Make the default cursor themed (sddm#705)

The X root window uses an "X" as the default cursor. To use a themed one,
it has to be set explicitly, e.g. by QML MouseAreas. For themes which do
not have a MouseArea that spans the entire screen, the "X" cursor would
be visible. By setting a cursor in the root QML object, the themed cursor
will be used by default. (https://bugs.kde.org/show_bug.cgi?id=337083)

[ChangeLog][Greeter] Fix default cursor appearance

* Add Hindi translations (sddm#706)


[ChangeLog][Translations] Add Hindi

Signed-off-by: Sanjeev Premi <spremi@ymail.com>

* Completed translation to Swedish (sddm#709)


[ChangeLog][Translations] Complete Swedish

Signed-off-by: Kristoffer Grundström <hamnisdude@gmail.com>

* Support Non-Latin characters in theme settings (sddm#708)

By default, QSettings doesn't support non-lating characters in config file.
However, KCM will write background path into theme config file without escape.
That means, we need to read UTF-8 strings.

[ChangeLog][Themes] Support UTF-8 in theme configuration

* Update fr.ts (sddm#710)

A better translation for the term "Layout" which corresponds in this
context to "keyboard".

Le "Layout" dans ce contexte correspond à la disposition du clavier.
Ce terme me semble plus parlant que "Configuration" qui est très général.

[ChangeLog][Translations] Improved French translation

* add fish shell specific commands to Xsession and wayland-session
to get the fish-specific login environment instead of the catchall /etc/profile environment.

* Unlock Gnome keyring on login (sddm#711)

Gnome's keyring stores user keys (eg: wifi passwords) encrypted, and uses
a pam module to unlock them at login.

This patch adds `optional` support for the gnome_keyring pam module, so
Gnome can be launched successfully from SDDM. Without this, Gnome will
ask for the users password again after logging in, the first time it needs
to access the keyring, in order to unlock it.

Other display managers as the Gnome Display Manger [1], LightDM [2] and
Enlightment's Entrance [3] already do this.

[1] https://github.com/GNOME/gdm/blob/master/data/pam-arch/gdm-password.pam
[2] http://bazaar.launchpad.net/~lightdm-team/lightdm/trunk/view/head:/debian/lightdm.pam
[3] https://git.enlightenment.org/misc/entrance.git/tree/data/entrance

[ChangeLog][Pam] Unlock GNOME keyring on login

* releng: Update create_changelog.pl

* releng: Fix Perl errors

* releng: Support GitHub issue references

* Move EnableHiDPI setting to X11 and Wayland sections

Let's have a different setting depending on the display server.

On Wayland we might have a chance to circumvent bad physical size reported
by some screen while on X11 it's harder because we cannot do that from
QPA, hence a user might want to disable HiDPI on X11 and enable it on
Wayland.

* Document EnableHiDPI setting

* Fix manual for Current theme setting

* add kwallet5 support

Add kwallet-pam support for the plasma5 desktop

* Implemented kwallet5 for autologon as well

Note: It is only working with an empty kwallet password.

* Failure log messages if gnome keyring is not installed.

If gnome keyring is not installed pam will log an error in the system log.  In order to supress the message a dash in front of the entry is required.

* Cleanup dangling pointer in SocketServer (sddm#725)

This fixes SDDM crashing if xorg fails to load

[ChangeLog][Auth] Fix crash if Xorg fails to load

* Fix all incorrect use of QStringLiteral

* Fix QStringLiteral

* autologin: try last successful session if no autologin session is set

* By this the user can decide which session to select for autologin without
  touching priviledged configuration file.
* If session is set in configuration, the behaviour is same as before

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>

* Support elogind as an alterantive session tracker for systemd-logind.

For users who do not want to run the full systemd suite, but do not
want to patch sddm to use ck-launch-session either, elogind can be
used as an alternative session tracker via its PAM module.

* Don’t install themes Main.qml/metadata.desktop twice, in some conditions they don’t get configured

* Add danish (da) translation (sddm#766)

* Simple theme 'maya' (sddm#717)

Add Maya theme

Signed-off-by: Sanjeev Premi <spremi@ymail.com>

* Update mailmap

* Install maya theme

* Also set QT_IM_MODULE in non testing mode

QT_IM_MODULE is set from a config value, however it currently is only
set in testing mode

* sddm-helper: x11: fix unsupported number of arguements error for unity session

Currently AFAICT the /etc/X11/Xsession script in Ubuntu is expecting 1 and only 1 arguments as the running command, as showed as the following fraction of /etc/X11/Xsession.d/20x11-common_process-args:

```sh
case $# in
  0)
    # No arguments given; use default behavior.
    ;;
  1)
    # One argument given; see what it was.
    case "$1" in
      failsafe)
        # Failsafe session was requested.
        if has_option allow-failsafe; then
          if [ -e /usr/bin/x-terminal-emulator ]; then
            if [ -x /usr/bin/x-terminal-emulator ]; then
              exec x-terminal-emulator -geometry +1+1
            else
              # fatal error
              errormsg "unable to launch failsafe X session ---" \
                       "x-terminal-emulator not executable; aborting."
            fi
          else
            # fatal error
            errormsg "unable to launch failsafe X session ---" \
                     "x-terminal-emulator not found; aborting."
          fi
        fi
        ;;
      default)
        # Default behavior was requested.
        ;;
      *)
        # Specific program was requested.
        STARTUP_FULL_PATH=$(/usr/bin/which "${1%% *}" || true)
        if [ -n "$STARTUP_FULL_PATH" ] && [ -e "$STARTUP_FULL_PATH" ]; then
          if [ -x "$STARTUP_FULL_PATH" ]; then
            STARTUP="$1"
          else
            message "unable to launch \"$1\" X session ---" \
                    "\"$1\" not executable; falling back to default session."
          fi
        else
          message "unable to launch \"$1\" X session ---" \
                  "\"$1\" not found; falling back to default session."
        fi
        ;;
    esac
    ;;
  *)
    # More than one argument given; we don't know what to do.
    message "unsupported number of arguments ($#); falling back to default" \
            "session."
    ;;
esac
```

Currently SDDM runs the Xsession script without quoting the second argument, which causes all xsessions that Exec key contains command-line arguments(like Unity(gnome-session --session=ubuntu)) causes Xsession to bail out with message "Xsession: unsupported number of arguments (2); falling back to default session."

This patch fixes the issue by quoting the %2 argument in the SessionCommand.

Signed-off-by: 林博仁 <Buo.Ren.Lin@gmail.com>

* Also theme the default cursor for the root window

The root window is still accessible in some cases, like context menu overlays.

* Ignore session desktop files with the Hidden property set to true

They are still read in the autologin case.

Fixes issue sddm#820

* Parse desktop file sections

Some desktop files have multiple sections, but for now we're only
interested in [Desktop Entry]. Without this patch, every entry was seen
as part of the [Desktop Entry] session, resulting in values getting
overwritten.

* updated Polish translation

Signed-off-by: Marcin Mikołajczak <me@m4sk.in>

* UserModel: Check for duplicates from getpwent()

* Corrections in Lithuanian language

Corrected some words.

* Add LIBXCB_INCLUDE_DIR to the list of include directories.

The daemon and the greeter include xcb/xcb.h, but they were relying on xcb's
include directory being implicitly added by the compiler instead of making
sure it was always passed to the compiler.

* Include errno.h and string.h where needed.

Do not rely on them being implicitly included by other headers; include
errno.h and string.h whenever errno and strerror(3) are used.

* Improve Catalan translation

* Bump version to 0.15.0

* Update changelog

* Stop assuming shadow(5) support is always available.

shadow and getspnam(3) are Linux-specific. Add a check for getspnam(3) to
CMake and only use the shadow functions if they exist, otherwise just use
getpwnam(), which on systems such as FreeBSD already performs the same
things shadow does on Linux.

* Update config docs

* Re-use existing sessions

Most desktop environments don't support logging in as the same user
twice, especially with system changes that means the DBUS session bus is
the same.

With this patch if a user tries to log in as a user that is already
logged in we unlock and activate that session rather than creating a new
session.

This behaviour is configurable with a config option. The default matches
the current behaviour.

* Add logind/CK2 seat support

This monitors for new seats using the standardised seat manager provided by:
systemd, standalone logind, systembsd, consolekit2, or any other implementation.

In none of the myriad of options are available, a single seat, seat0, is created
(which is the current behaviour)

* Fix typos in config documentation

Mentions wrong path.

* Explicity set XDG_SEAT env var when starting the user session.

* Added posibility to change border width of ComboBox widget.

* Exclude .gitattributes from themes

Do not install .gitattributes when installing a theme.

* Log theme configuration path

This helps debugging problems.

* Fix theme metadata default values

Default values where wrong resulting in theme configuration not
being loaded by Display.

[ChangeLog][ThemeMetadata] Fix default values

* Don't log an error if elogind is not present (sddm#884)

* Prevent errors when pam_systemd is not available

Don't print errors on elogind systems.

*  remove unnecessary indentation (sddm#899)

* Update translations

Update .ts files and CMakeLists.txt, and fix Ukrainian.

Signed-off-by: Marcin Mikołajczak <me@m4sk.in>

* Remove duplicate translations

* Update change log

Add separator in change log, reformat v0.15.0 and add v0.16.0 items.

* Bump version to 0.16.0

* Add configuration directory to change log

* 0.16.0 (sddm#900)

Merge develop into master.

* Update release notes

* man: sddm.conf.rst.in fix syntax error

- missing *

* man: update for the new configuration dirs and files

* Update zh_TW translations.

* Fix ComboBox

This fixes a duplicate which qml doesn't allow.

* Adjust order of components in the default PATH

There is no reason to prefer executables in /bin over others, this has
in fact caused issues on a system where /bin is a symlink to usr/bin
(https://gitlab.kitware.com/cmake/cmake/issues/17330).

This order also matches systemd's default for bin (see systemd.exec(5)).

* helper: Declare dependency on Qt5::Qml.

Authrequest.h includes <QtQml>, so make sure it's found on systems
where it exists in a different directory from the rest of Qt.

* Update lt.ts

* Update de.ts

* Fix connection of PropertiesChanged event for LogindSeat

SDDM fails to start properly because the seat0 changes the property
canGraphical after SDDM is started and the connection to watch the
PropertiesChanged event didn't work.

* Added missing utmp/wtmp/btmp handling

* Make greeter see icons set by AccountsServices. Resolves sddm#683

* man: sddm.greeter.rst.in fix syntax error 

missing *

* Set a default InputMethod

Otherwise we choke by default when importing QtVirtualKeyboard

* Refactor setupDisplay() to use two distinct processes to avoid race conditions. Fixes Xsetup script.

* Update contributors list

* Update change log

* Bump version to 0.17.0

* Update Korean translations

* Update Catalan translation

* add --example-config to man page

* Fix race between sddm and logind

Make sure sddm is run after logind.
An explicit dependency will make sddm run after logind every time.

Closes: sddm#978

* Add .gitattributes

Some files shouldn't be exported with git archive.

* Don't use QMap with a pointer key (sddm#971)

QMap sorts it's keys, but sorting by memory address makes little sense.
Using QHash instead, which provides faster lookups and don't sort the keys.

The same rationale applies to QMultiMap which is just a  is a convenience
QMap subclass that provides multi-valued maps.

* Fix error when session command has multiple arguments (sddm#732)

* Don't quit on SIGHUP

SIGHUP is sent to daemons on reload, so they should reread their configuration.
Currently sddm would just quit on reload, which is very unexpected.

* Add SOCK_CLOEXEC to signal handling sockets

SDDM is currennty leaking 8 sockets file descriptors to the user session.
Adding the CLOEXEC flag to the fd to avoid thoses leaks.

* Support for theme supplied default avatars

This patch adds support for custom default avatars
under $ThemeDir/themeName/faces.

This will make sddm use an avatar icon that is provided by
the theme and is consistent with its look.

* Remove COMPONENTS_VERSION

We only have SDDM components version 2.0 and no longer maintain
two versions at the same time like we used to do before.

* Set default options value

* Do not load both systemd and elogind PAM modules

Select which one needs to be loaded based on configure options.

* Bump Qt requirement to 5.8.0

Require Qt 5.8.0 so we are all set for QtQuick Controls 2
and QtWayland Compositor.

* If there is still a session running on some display,
switch to last display in display vector.

VirtualTerminal::chVt code inspired by chvt utility.

This fixes the following bug:
1. Login user A
2. Switch user
3. New session: login user B
4. Switch to user A
5. Logout user A
=> Virtual terminal is not switched to session of user B,
   but shows a text terminal login or is blank.

This code works with Xorg sessions. Wayland sessions seem
to have other problems when logging out, this fix does not
address these.

* Integrate the VT switching fix into existing jumpToVt():
Do not handle the VT switching yourself by setting VT_PROCESS,
but let the kernel switch VTs automatically (VT_AUTO).
After session end there is no controlling process anymore
which could send the VT_RELDISP ioctl to release the switch.

* Check for getpwnam_r error status. Fixes sddm#489

* greeter: Use Qt command line parser

Do not reinvent the wheel with a command line parser.
Restructure the code so that GreeterApp no longer need to
parse arguments itself.

* Add Namespaces setting

This option holds a comma-separated list of paths bound to Linux namespaces to
enter with setns() before starting the user session.

The main intention is to let user sessions start in a protected network
namespace, while the display server remains in the initial network namespace to
talk to udev, and udev remains in the initial network namespace to talk to
systemd.

[ChangeLog][General] Add "Namespaces" setting under "General" to enter specified
Linux namespaces before starting the user session

* Update man page about default path

Closes: sddm#958

* Fix platform detection for EnableHiDPI

We can't use QGuiApplication before it's constructed, so find out which
platform is requested ourselves.

Fixes sddm#894

* Remove trailing spaces

* Fix build

* Fix build

* UserModel: optimize filtering out duplicate users (sddm#995)

Instead of using naive approach of trying to detect duplicates when
inserting a new user into the list of users, which is O(n^2) complexity,
let's filter them out after the fact, which is much more efficient on
real-world data.

With this change time to load user list in our environment (over 500000
account entries) is reduced from over 1 hour to about 2 seconds.

* UserModel: fix filtering out duplicate users (sddm#998)

std::unique() is "interesting": it modifies the container, rearranging
elements in it, but does not reduce the size of the container, so there
are invalid elements at the end that have to be erased explicitly.

* Do not install sddm.conf by default (sddm#996)

sddm.conf overrides the configuration from the conf.d
directories and we don't want that.

SDDM still reads it if users keep the file after an
upgrade, but since the introduction of conf.d directories
we shouldn't install sddm.conf by default.

[ChangeLog][Daemon] Do not install /etc/sddm.conf anymore

* Fix build with Qt < 5.10: Use QString instead of QLatin1String (sddm#1001)

QLatin1String only got more QString-like with Qt 5.10, so we can't use
those methods.

* Add Icelandic Translations (sddm#1002)

Add Icelandic translation file.

[ChangeLog][Translations] Add Icelandic

* UserModel: optimize setting of default user icon (sddm#999)

Instead of checking for existence of theme-specific icon and re-creating
string literals every time we add a new user to the list, do it once.
It helps in large organizations with a lot of users.

* adding Bangla translation (sddm#1006)

Signed-off-by: now-im <now.im.627@gmail.com>

* Skip theme for greeter call if none is set

- fix loading default theme if none is set

* Honor PAM's ambient supplemental groups. (sddm#834)

When compiled with USE_PAM, prefer a combination of
getgroups(3) and getgrouplist(3) for ambient and user
groups, respectively, to initgroups(3).

This way, groups injected into the PAM environment
by means of pam_groups.so aren't ignored.

Signed-off-by: J. Konrad Tegtmeier-Rottach <jktr@0x16.de>

* XorgDisplayServer.cpp: Check pipe output if there is nothing (sddm#1021)

X server may break down without writing a display number
to the pipe specified by '-displayfd'. SDDM should exit explictly
in such cases. Otherwise, it will get a null string for display number,
which leads /usr/bin/xauth gets bad parameters, i.e.

    /usr/bin/xauth: (stdin):1:  bad "remove" command line
    /usr/bin/xauth: (stdin):2:  bad "add" command line

* Update Korean translations (sddm#1025)

* Fix build with Qt 5.11 (sddm#1024)

qt5_use_modules was deprecated for quite some time and got finally removed.

* Fix sddm-greeter exit if it can't connect to the daemon (sddm#1016)

* Fixed typo that prevents ConsoleKit to be detected (sddm#1027)

* Don't add session files with NoDisplay=true to SessionModel (sddm#1029)

Same treatment as for Hidden. SessionModel is not used for autologin,
so for all intents and purposes it's the same. If a user logged in with
a NoDisplay=true session, the last session index will be incorrect, but
IMO that's the intended behaviour of NoDisplay.

* Fix missing include in HelperApp.cpp

SDDM did not compile on musl libc, since HelperApp.cpp was using
gettimeofday(), which is defined in <sys/time.h>, without importing it.

[ChangeLog][Helper] Fix build with musl libc.

* add new translations

translated hibernate and suspend
add  enter your password/ username for to use with tooltips

* add new translation

add translation for hibernate and suspend
add translation toenter username/ password for to use with tooltips

* Fix authentication when reusing an existing session

- Check the success value before unlocking the session
- Don't attempt to use the nonexistant "sddm-check" PAM service

* Adds sourcing of /etc/profile to fish

This ensures the right paths are set by upstream apps that use the
/etc/profile(.d) method for setting paths, for example xdg or snap.

Signed-off-by: James Turnbull <james@lovedthanlost.net>

[ChangeLog][Xsession] Source /etc/profile for fish too

Closes: sddm#879

* Fix switchToGreeter not available without logind

Seats can't be created until SeatManager's signals are
connected to the DisplayManager, or the latter won't see
them and switchToGreeter doesn't work. So split SeatManager
initialization from its constructor and call initialize it
only after all connections have been set up in DaemonApp's
constructor.

With logind there may have been enough delay before seats
got actually added so things would work, but it's still
cleaner to fix the order.

Fixes: https://bugs.gentoo.org/644718
Fixes: sddm#824

* Remove correct view when a screen is removed

This connect was done for all views so previously when any screen was
removed all views would be.

* Bump to 0.18.0

* Handle session re-use in the same slot as everything else

m_auth is connected to ::authentication in the constructor so use of a
second connect is really weird and runs in an undetermined order
  • Loading branch information
leuqarte committed Aug 27, 2018
1 parent 0537277 commit 5a91b5e
Show file tree
Hide file tree
Showing 206 changed files with 8,125 additions and 1,879 deletions.
17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# remove files from deployment using `git archive`

# common files
.commit-template export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.mailmap export-ignore
.travis.yml export-ignore

# several files and directories we never want to export
# a little bit belt and braces as the most of these files
# should never ever be in the repository

*~ export-ignore
.kdev4 export-ignore
*build* export-ignore
*.user export-ignore
3 changes: 3 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ Andrea Scarpino <me@andreascarpino.it> <andrea@archlinux.org>
Isaque Galdino <igaldino@gmail.com> <izup@fake.com>
raffarti <raffarti@zoho.com> <raffarti@localhost.localdomain>
Martin Briza <mbriza@redhat.com> <m@rtinbriza.cz>
David Edmundson <kde@davidedmundson.co.uk> <david@davidedmundson.co.uk>
Pier Luigi Fiorini <pierluigi.fiorini@liri.io> <pierluigi.fiorini@gmail.com>
Pier Luigi Fiorini <pierluigi.fiorini@liri.io> <plfiorini@users.noreply.github.com>
63 changes: 28 additions & 35 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,33 @@
language: cpp

compiler:
- clang
- gcc

before_install:
- if [ "$CXX" == "g++" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
- if [ "$CXX" == "clang++" ]; then sudo add-apt-repository -y ppa:h-rayflood/llvm; fi

- sudo apt-add-repository -y ppa:ubuntu-sdk-team/ppa
- sudo add-apt-repository ppa:czchen/travis-ci -y
- sudo apt-get update -y
install:
# gcc
- if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.8; fi
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8"; fi
# clang
- if [ "$CXX" == "clang++" ]; then sudo apt-get install --allow-unauthenticated -qq clang-3.4; fi
- if [ "$CXX" == "clang++" ]; then export CXX="clang++-3.4"; fi

- sudo apt-get install qtdeclarative5-dev qttools5-dev qttools5-dev-tools
- sudo apt-get install -qq libpam0g-dev libX11-dev libx11-xcb-dev
- sudo apt-get install cmake -y

- sudo wget http://mirrors.kernel.org/ubuntu/pool/main/libx/libxcb/libxcb1_1.10-2ubuntu1_amd64.deb
- sudo wget http://mirrors.kernel.org/ubuntu/pool/main/libx/libxcb/libxcb-xkb1_1.10-2ubuntu1_amd64.deb
- sudo wget http://mirrors.kernel.org/ubuntu/pool/main/libx/libxcb/libxcb1-dev_1.10-2ubuntu1_amd64.deb
- sudo wget http://mirrors.kernel.org/ubuntu/pool/main/libx/libxcb/libxcb-xkb-dev_1.10-2ubuntu1_amd64.deb
- sudo dpkg --force-depends -i libxcb1_1.10-2ubuntu1_amd64.deb
- sudo dpkg --force-depends -i libxcb-xkb1_1.10-2ubuntu1_amd64.deb
- sudo dpkg --force-depends -i libxcb1-dev_1.10-2ubuntu1_amd64.deb
- sudo dpkg --force-depends -i libxcb-xkb-dev_1.10-2ubuntu1_amd64.deb

before_script:
- mkdir build
- cd build
- cmake ..

script: make

sudo: required

env:
- PAM=0
- PAM=1

arch:
packages:
- pam
- python-docutils
- qt5-declarative
- qt5-tools
- extra-cmake-modules
- clang
- git
script:
- if [ "$PAM" == "0" ]; then cmake -DBUILD_MAN_PAGES=ON -DENABLE_PAM:BOOL=OFF .; fi
- if [ "$PAM" == "1" ]; then cmake -DBUILD_MAN_PAGES=ON -DENABLE_PAM:BOOL=ON .; fi
- make

script:
- "curl -s https://raw.githubusercontent.com/mikkeloscar/arch-travis/master/arch-travis.sh | bash"

notifications:
email: false
irc:
- "chat.freenode.net#sddm"
128 changes: 108 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.8.8)

project(SDDM)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
Expand All @@ -14,16 +13,33 @@ endif()

# Set version
set(SDDM_VERSION_MAJOR 0)
set(SDDM_VERSION_MINOR 11)
set(SDDM_VERSION_MINOR 18)
set(SDDM_VERSION_PATCH 0)
set(SDDM_VERSION_STRING "${SDDM_VERSION_MAJOR}.${SDDM_VERSION_MINOR}.${SDDM_VERSION_PATCH}")

# Set up packaging
set(CPACK_PACKAGE_NAME "sddm")
set(CPACK_PACKAGE_VERSION "${SDDM_VERSION_STRING}")
set(CPACK_GENERATOR "TGZ")
set(CPACK_SET_DESTDIR FALSE)
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
set(CPACK_SOURCE_IGNORE_FILES "/build/;/.git;/*.user;/.tx/;~$;${CPACK_SOURCE_IGNORE_FILES}")
include(CPack)
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)

# Options
option(BUILD_MAN_PAGES "Build man pages" OFF)
option(ENABLE_JOURNALD "Enable logging to journald" ON)
option(ENABLE_PAM "Enable PAM support" ON)
option(NO_SYSTEMD "Disable systemd support" OFF)
option(USE_ELOGIND "Use elogind instead of logind" OFF)

# ECM
find_package(ECM 1.4.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH};${ECM_MODULE_PATH}")

# Definitions
add_definitions(-Wall -std=c++11)
add_definitions(-Wall -std=c++11 -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY)

# Default build type
if(NOT CMAKE_BUILD_TYPE)
Expand Down Expand Up @@ -52,17 +68,25 @@ endif()
# Standard installation paths
include(GNUInstallDirs)

# Macros
include(FeatureSummary)

# PKG-CONFIG
find_package(PkgConfig)

# PAM
if(NOT NO_PAM)
find_package(PAM)
if(ENABLE_PAM)
find_package(PAM REQUIRED)

if(PAM_FOUND)
add_definitions(-DUSE_PAM)
endif()
endif()
add_feature_info("PAM" PAM_FOUND "PAM support")

# getspnam and shadow(5) support
include(CheckFunctionExists)
check_function_exists(getspnam HAVE_GETSPNAM)

# XCB
find_package(XCB REQUIRED)
Expand All @@ -71,34 +95,37 @@ find_package(XCB REQUIRED)
find_package(XKB REQUIRED)

# Qt 5
find_package(Qt5Core REQUIRED)
find_package(Qt5DBus REQUIRED)
find_package(Qt5LinguistTools REQUIRED)
find_package(Qt5 5.8.0 CONFIG REQUIRED Core DBus Gui Qml Quick LinguistTools Test)

# find qt5 imports dir
get_target_property(QMAKE_EXECUTABLE Qt5::qmake LOCATION)
exec_program(${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_QML" RETURN_VALUE return_code OUTPUT_VARIABLE QT_IMPORTS_DIR)

# Set components version
set(COMPONENTS_VERSION 2.0)
if(NOT QT_IMPORTS_DIR)
exec_program(${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_QML" RETURN_VALUE return_code OUTPUT_VARIABLE QT_IMPORTS_DIR)
endif()

# Uninstall target
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)

add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
if ("${ECM_VERSION}" VERSION_LESS "1.7.0")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
endif()

# systemd
if(NOT NO_SYSTEMD)
if(NOT NO_SYSTEMD AND NOT USE_ELOGIND)
pkg_check_modules(SYSTEMD "systemd")
endif()

if(SYSTEMD_FOUND)
add_definitions(-DHAVE_SYSTEMD)
set(CMAKE_AUTOMOC_MOC_OPTIONS -DHAVE_SYSTEMD)

pkg_check_modules(JOURNALD "libsystemd-journal")
# libsystemd-journal was merged into libsystemd in 209
if(${SYSTEMD_VERSION} VERSION_LESS 209)
pkg_check_modules(JOURNALD "libsystemd-journal")
else()
pkg_check_modules(JOURNALD "libsystemd")
endif()

if(ENABLE_JOURNALD)
if(JOURNALD_FOUND)
Expand All @@ -119,26 +146,87 @@ if(SYSTEMD_FOUND)
set(REBOOT_COMMAND "/usr/bin/systemctl reboot")
else()
set(SYSTEMD_FOUND 0)
endif()
add_feature_info("systemd" SYSTEMD_FOUND "systemd support")
add_feature_info("journald" JOURNALD_FOUND "journald support")

# elogind
if(NO_SYSTEMD AND USE_ELOGIND)
pkg_check_modules(ELOGIND "libelogind")
endif()

if(ELOGIND_FOUND)
add_definitions(-DHAVE_ELOGIND)
set(CMAKE_AUTOMOC_MOC_OPTIONS -DHAVE_ELOGIND)

set(MINIMUM_VT 7)
set(HALT_COMMAND "/usr/bin/loginctl poweroff")
set(REBOOT_COMMAND "/usr/bin/loginctl reboot")
endif()
add_feature_info("elogind" ELOGIND_FOUND "elogind support")

# Default behaviour if neither systemd nor elogind is used
if (NOT ELOGIND_FOUND AND NOT SYSTEMD_FOUND)
set(MINIMUM_VT 7)
set(HALT_COMMAND "/sbin/shutdown -h -P now")
set(REBOOT_COMMAND "/sbin/shutdown -r now")
endif()


# Set constants
set(DATA_INSTALL_DIR "${CMAKE_INSTALL_FULL_DATADIR}/sddm" CACHE PATH "System application data install directory")
set(DBUS_CONFIG_DIR "${CMAKE_INSTALL_SYSCONFDIR}/dbus-1/system.d" CACHE PATH "DBus config files directory")
set(STATE_DIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/sddm" CACHE PATH "State directory")
set(RUNTIME_DIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/run/sddm" CACHE PATH "Runtime data storage directory")

set(SESSION_COMMAND "${DATA_INSTALL_DIR}/scripts/Xsession" CACHE PATH "Script to execute when starting the desktop session")
set(SESSION_COMMAND "${DATA_INSTALL_DIR}/scripts/Xsession" CACHE PATH "Script to execute when starting the X11 desktop session")
set(WAYLAND_SESSION_COMMAND "${DATA_INSTALL_DIR}/scripts/wayland-session" CACHE PATH "Script to execute when starting the Wayland desktop session")

set(CONFIG_FILE "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sddm.conf" CACHE PATH "Path of the sddm config file")
set(CONFIG_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sddm.conf.d" CACHE PATH "Path of the sddm config directory")
set(SYSTEM_CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/lib/sddm/sddm.conf.d" CACHE PATH "Path of the system sddm config directory")
set(LOG_FILE "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/log/sddm.log" CACHE PATH "Path of the sddm log file")
set(DBUS_CONFIG_FILENAME "org.freedesktop.DisplayManager.conf" CACHE STRING "Name of the sddm config file")
set(COMPONENTS_TRANSLATION_DIR "${DATA_INSTALL_DIR}/translations" CACHE PATH "Components translations directory")


# Autodetect UID_MIN and UID_MAX from /etc/login.defs
if(NOT DEFINED LOGIN_DEFS_PATH)
set(LOGIN_DEFS_PATH "/etc/login.defs" CACHE PATH "Path to login.defs")
endif()

if(NOT EXISTS "${LOGIN_DEFS_PATH}" AND NOT DEFINED UID_MIN AND NOT DEFINED UID_MAX)
message(FATAL_ERROR "Could not find login.defs at ${LOGIN_DEFS_PATH}. Try -DLOGIN_DEFS_PATH.")
endif()

if(NOT DEFINED UID_MIN)
file(STRINGS "${LOGIN_DEFS_PATH}" UID_MIN LIMIT_COUNT 1 REGEX "^UID_MIN")
string(REGEX REPLACE "^UID_MIN[\t ]+([0-9]+)" "\\1" UID_MIN "${UID_MIN}")
if(NOT UID_MIN MATCHES "[0-9]+")
message(WARNING "Could not detect a valid UID_MIN (got '${UID_MIN}'). You should review your login.defs file.")
set(UID_MIN 1000)
else()
message(STATUS "Autodetected UID_MIN=${UID_MIN} from ${LOGIN_DEFS_PATH}")
endif()
endif()

if(NOT DEFINED UID_MAX)
file(STRINGS "${LOGIN_DEFS_PATH}" UID_MAX LIMIT_COUNT 1 REGEX "^UID_MAX")
string(REGEX REPLACE "^UID_MAX[\t ]+([0-9]+)" "\\1" UID_MAX "${UID_MAX}")
if(NOT UID_MAX MATCHES "[0-9]+")
message(WARNING "Could not detect a valid UID_MAX (got '${UID_MAX}'). You should review your login.defs file.")
set(UID_MAX 65000)
else()
message(STATUS "Autodetected UID_MAX=${UID_MAX} from ${LOGIN_DEFS_PATH}")
endif()
endif()

# Add subdirectories
add_subdirectory(components)
add_subdirectory(data)
add_subdirectory(services)
add_subdirectory(src)
add_subdirectory(test)

# Display feature summary
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)

0 comments on commit 5a91b5e

Please sign in to comment.