Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Invalid password message #49

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joshuamegnauth54
Copy link
Contributor

Closes: #41

@joshuamegnauth54 joshuamegnauth54 marked this pull request as draft May 24, 2024 06:51
This commit technically closes pop-os#41 but the issue is deeper than the
message itself. The message `unable to send message: Connection refused
(os error 111)` overrides the failed login prompt. `COSMIC greeter`
seems to be sending a stray message over the socket.
@jackpot51
Copy link
Member

An auth error does not have to be a password related error. I think the connection refused error is not coming from PAM. When we get an error from PAM we should display it as it was provided.

@joshuamegnauth54
Copy link
Contributor Author

You're right about the connection refused error. I've been messing around with this for a week but I can't figure out what's causing that error.

Through the magic of print debugging...:

[2024-05-30T04:56:14Z INFO  cosmic_greeter::greeter] focus surface Id(1)
[2024-05-30T04:56:39Z INFO  cosmic_greeter::greeter] Sending request over socket: PostAuthMessageResponse { response: Some("gaben") }
[2024-05-30T04:56:39Z INFO  cosmic_greeter::greeter] Request: PostAuthMessageResponse { response: Some("gaben") }
[2024-05-30T04:56:39Z INFO  cosmic_greeter::greeter] Waiting for a writable socket
[2024-05-30T04:56:39Z INFO  cosmic_greeter::greeter] Writing bytes
[2024-05-30T04:56:39Z INFO  cosmic_greeter::greeter] Reading response from socket
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] Response: Error { error_type: AuthError, description: "pam_authenticate: AUTH_ERR" }
[2024-05-30T04:56:42Z ERROR cosmic_greeter::greeter] AuthError => pam_authenticate: AUTH_ERR
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] Sending request over socket: CancelSession
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] Request: CancelSession
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] Waiting for a writable socket
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] Writing bytes
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] Reading response from socket
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] Response: Error { error_type: Error, description: "unable to send message: Connection refused (os error 111)" }
[2024-05-30T04:56:42Z ERROR cosmic_greeter::greeter] Error => unable to send message: Connection refused (os error 111)
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] Sending request over socket: CancelSession
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] Request: CancelSession
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] Waiting for a writable socket
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] Writing bytes
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] Reading response from socket
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] Response: Success
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] CancelSession => Recreating session
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] updating wallpaper for "VGA-1"
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] Sending request over socket: CreateSession { username: "josh" }
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] Request: CreateSession { username: "josh" }
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] Waiting for a writable socket
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] Writing bytes
[2024-05-30T04:56:42Z INFO  cosmic_greeter::greeter] Reading response from socket

...I found out that the first CancelSession triggers the connection refused error, but then the second CancelSession + CreateSession succeeds.

I tried switching to greet_ipc's TokioCodec plus adding a lock on the socket. That fixed the spurious login failures I've experienced but didn't help with this issue.

So. I might be stumped.

@jackpot51
Copy link
Member

It's okay, I am confused by it as well. If TokioCodec helps with another problem might as well PR that piece separately.

@joshuamegnauth54
Copy link
Contributor Author

Sorry. I ended up really busy for these last few days. I just opened a PR fixing the deadlocks issue though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clearer wrong-password responses
2 participants