config: Fix tests for service config
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)
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 <firstname.lastname@example.org>
Add ReGreet to list of known greetd greeters
cargo: Update dependencies
readme: Add ddlm, note list updates welcome
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.  Such user mounts have been common for encrypted home folders
since 2003.  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.
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.
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
greetd: add terminal switch flag configuration option
This adds "switch" true/false flag in "terminal" section of
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