[Bug] login fails silently when .profile contains invalid or failing shell code #871

Closed
opened 2025-11-21 14:36:59 +01:00 by dragsbruh · 2 comments

Pre-requisites

  • I have looked for any other duplicate issues

Ly version

1.3.0-dev.19+816be74

Observed behavior

if the users ~/.profile contains a command that errors, ly fails the login silently.
the login screen succeeds, briefly flashes, and returns to login screen again with no visible error and no logs about the error (i dont think it sees it as an error)

in my case, i previously uninstalled an application but still had this:

. "$HOME/.zv/bin/env"

which fails because the file doesnt exist

Expected behavior

If .profile fails to execute:

ly should show an authentication/session error, or
log an error message that the shell profile failed to run

silent failure makes it extremely hard to diagnose

OS + Desktop environment/Window manager

Arch Linux / Niri (de/wm doesnt matter in this case)

Steps to reproduce

  1. add invalid shell code to ~/.profile, for example:

    . "this-file-does-not-exist.sh"
    
  2. log out

  3. try logging in through ly to that user

  4. login will instantly fail with no error message

Relevant logs

initializing termbox2
termbox2 set to 24-bit color output mode
screen resolution is 240x67
authenticating...
[pam] starting session
[pam] setting tty
[pam] authenticating
[pam] validating account
[pam] setting credentials
[pam] opening session
logged out
authenticating...
[pam] starting session
[pam] setting tty
[pam] authenticating
[pam] validating account
[pam] setting credentials
[pam] opening session
logged out
authenticating...
[pam] starting session
[pam] setting tty
[pam] authenticating
[pam] validating account
[pam] setting credentials
[pam] opening session
logged out
authenticating...
[pam] starting session
[pam] setting tty
[pam] authenticating
[pam] validating account
[pam] setting credentials
[pam] opening session
logged out

Additional information

session log is empty

### Pre-requisites - [x] I have looked for any other duplicate issues ### Ly version 1.3.0-dev.19+816be74 ### Observed behavior if the users `~/.profile` contains a command that errors, ly fails the login silently. the login screen succeeds, briefly flashes, and returns to login screen again with no visible error and no logs about the error (i dont think it sees it as an error) in my case, i previously uninstalled an application but still had this: ```sh . "$HOME/.zv/bin/env" ``` which fails because the file doesnt exist ### Expected behavior If `.profile` fails to execute: ly should show an authentication/session error, or log an error message that the shell profile failed to run silent failure makes it extremely hard to diagnose ### OS + Desktop environment/Window manager Arch Linux / Niri (de/wm doesnt matter in this case) ### Steps to reproduce 1. add invalid shell code to `~/.profile`, for example: ```sh . "this-file-does-not-exist.sh" ``` 2. log out 3. try logging in through ly to that user 4. login will instantly fail with no error message ### Relevant logs ```shell initializing termbox2 termbox2 set to 24-bit color output mode screen resolution is 240x67 authenticating... [pam] starting session [pam] setting tty [pam] authenticating [pam] validating account [pam] setting credentials [pam] opening session logged out authenticating... [pam] starting session [pam] setting tty [pam] authenticating [pam] validating account [pam] setting credentials [pam] opening session logged out authenticating... [pam] starting session [pam] setting tty [pam] authenticating [pam] validating account [pam] setting credentials [pam] opening session logged out authenticating... [pam] starting session [pam] setting tty [pam] authenticating [pam] validating account [pam] setting credentials [pam] opening session logged out ``` ### Additional information session log is empty
Owner

@dragsbruh "Logged out" essentially means Ly did not retrieve any error, and it's likely that it'll stay that way. After a session is launched, there's no way for Ly to retrieve an error if whatever launched the session didn't return one. In this case, it's likely the shell silently fails, and I don't think there's much I can do about it.

@dragsbruh "Logged out" essentially means Ly did not retrieve any error, and it's likely that it'll stay that way. After a session is launched, there's no way for Ly to retrieve an error if whatever launched the session didn't return one. In this case, it's likely the shell silently fails, and I don't think there's much I can do about it.
Author

i see thats fair then, im closing the issue

i see thats fair then, im closing the issue
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
fairyglade/ly#871
No description provided.