server: cargo fmt
config: Fix tests for service config
a7c8ac89 — Jonathan Sköld 2 months ago
agreety: Return error if no input when prompted

If EOF is provided when the user is prompted agreety would panic. This
commit fixes that by returning an error instead causing graceful exit(1)
95ab9cdc — Arnaud Ferraris 7 months ago
config: allow using custom PAM configs

In the event several greeters are installed, each needing a specific PAM
config, it could be useful to have each greeter having its own config
file (which is already possible), each one indicating the PAM config to
be used with this greeter (which is not possible for now).

This commit adds a new (optional) "service" key to the "general",
"default_session" and "initial_session" sections so users and/or
distributions can have more flexibility regarding PAM config management.

In case this option is missing from the config file, we fall back to the
default "greetd" and "greetd-greeter" config names.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
c597e82b — Harish Rajagopal 3 months ago
Add ReGreet to list of known greetd greeters
Bump version to 0.9.0
cargo: Update dependencies
readme: Add ddlm, note list updates welcome
cargo: Update tokio
For FUSE-based home folders, chdir into them as the user instead of root.

By default, filesystems user-mounted via FUSE are not accessible to
root. [1] Such user mounts have been common for encrypted home folders
since 2003. [2][3][4] This change accommodates users with those home

Greetd previously sent affected users into the root directory ("/")
because their home folders were inaccessible to root.

Now the directory operation occurs after a user's privileges were
assumed. Users find themselves in their home folders after logging in.

Since the call to PAM's open_session now takes place before any change
of folders, the value of the current directory is no longer being
exposed to the modules via the environment variable $PWD, but the PAM
environment is distinct from the process environment.

This commit was tested on Guix without commit 424ecac4 since the Rust
crate for nix 0.20 was not immediately available there.

[1] https://unix.stackexchange.com/a/17423
[2] https://en.wikipedia.org/wiki/Comparison_of_disk_encryption_software
[3] https://en.wikipedia.org/wiki/EncFS
[4] https://nuetzlich.net/gocryptfs/
fakegreet: reset state on errors

Some greeters were sending CancelSession in response to Error, likely
because it was necessary for a consistent internal state of fakegreet.

Change fakegreet to comply with the protocol doc, which states that the
sessions are automatically cancelled on error, and remove the need for
the redundant CancelSession.
Change order of setting pam environment variables.

Set the variables coming from a greeter first to ensure that the
duplicates will be overwritten by the values from greetd worker.
ipc: ensure backward compatibility of the protocol

If the client was compiled with the previous version of the protocol,
initialize StartSession.env with the default value instead of failing to
deserialize the message.
Revert "Remove 'env' from start_session"

This reverts commit 1bc6ddbf67397494b7097e92a901344782d394ae.
Minor doc adjustments
readme: Add reference to QtGreet
Use /bin/sh instead of $SHELL

$SHELL variable is not set yet at this moment, so it is hardly a good
idea to use it. /bin/sh is completely generally available shell on all
UNIX platforms.
compat: Upgrade nix to 0.20 for x32 support

Closes: https://todo.sr.ht/~kennylevinsen/greetd/29
greetd: add terminal switch flag configuration option

This adds "switch" true/false flag in "terminal" section of
configuration file.

Flag controls whether terminal under control should be switched to
when greetd starts. If "switch" set to true, greetd behaves as it
did before, on start vt_setactivate will be called. If "switch" set
to false, and terminal under control by greetd is not currently
active VT, greetd will wait for terminal to become active with
vt_waitactive, which translates to VT_WAITACTIVE ioctl call.

* greetd/src/config/mod.rs: add "switch" flag
* greetd/src/server.rs: add using "switch" flag and waiting for active
* greetd/src/terminal/mod.rs: add vt_waitactive method
* man/greetd-5.scd: mention "switch" configuration option