R
R
Ruslan Gilfanov2019-07-10 17:52:13
linux
Ruslan Gilfanov, 2019-07-10 17:52:13

How to implement and test greeter for LightDM in Python?

LightDM is a C desktop manager that allows users to run a graphical desktop environment on GNU/Linux operating systems.
LightDM architecture is modular:

  • there is a daemon responsible for authorizing and launching the desktop environment;
  • there is greeter - a graphical application with a welcome window and a GNU / Linux user authorization form.

There are many greeters, but my task is to write my own greeter in Python that interacts with the demon.
The documentation describing the LightDM daemon API is not very good and resembles a mean reference to modules and functions with a not fully understood example of a simple greeter in C language (see here in the Description section).
Also in the LightDM sources on GitHub, I found an example of a test greeter in Python , written in a functional style and without any documentation or comments.
In addition, a GitHub search of the repositories for "LightDM language:python" yielded other examples of Python greasers (mostly abandoned):
  • web greeter
  • enter
  • gecosws-lightdm-autologin

The test case from the LightDM sources, in comparison with other examples, looks unnecessarily overcomplicated. All the functionality is implemented there, Linux environment variables are explicitly requested and for some reason a unix socket is used, which somehow apparently needs to be specified for the daemon.
It seems that all Python examples use GObject signals that pull API methods, and several API methods are responsible for authorizing and opening a session at once.
But according to the sources of third-party greeters, I do not fully understand:
  • How is the authorization and validation of the user's password, as well as the opening of the session? Especially the password validation raises questions, which seems to be denoted by the word prompt instead of password. At the same time, the show_prompt method often appears, which is strange for validation.
  • Is it possible to test the interaction of a greeter with a daemon as a regular user? Or is it necessary after each change to edit the system configs and reboot the machine?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question