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

should set Password improperly disconnect once already set it correctly? #42

Open
liocle opened this issue Mar 4, 2024 · 3 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@liocle
Copy link
Collaborator

liocle commented Mar 4, 2024

If setting password twice (that includes by mistake ;) the server disconnects the session:

c3r1p3 :: ~ % nc -c localhost 6667 1 ↵ PASS horse USER lio PASS toto ERROR :Password incorrect c3r1p3 :: ~ % nc -c localhost 6667

@liocle liocle added bug Something isn't working question Further information is requested labels Mar 4, 2024
@liocle
Copy link
Collaborator Author

liocle commented Mar 4, 2024

Is it correct behavior?
PASS correct
USER asdf
PASS again_Incorrect

@mxafi
Copy link
Owner

mxafi commented Mar 22, 2024

Currently disconnecting is somewhat valid maybe, we can check later the proper behavior by hosting ngircd server or something...

@mxafi mxafi added enhancement New feature or request and removed bug Something isn't working labels Mar 22, 2024
@djames9 djames9 mentioned this issue Mar 22, 2024
@mxafi
Copy link
Owner

mxafi commented Mar 23, 2024

Changing the behavior to match ngircd would require some refactoring:

  • Most commands are silent before the client being authenticated
  • The password is checked to be correct only after NICK and USER have been supplied (in any order)
  • Giving PASS first is not a requirement, only that after NICK and USER have been supplied, it is checked if it was supplied and if it was correct.

So NICK, USER, PASS would have to be just input functions. NICK and USER have to check if the other has already been given, if so, then run some utility getAuthenticated function.
This utility function would check if nick, user, pass have all been given and the password is correct, if not, return some error. Otherwise, the function would send back the numeric auth replies 1-4

@mxafi mxafi removed the question Further information is requested label Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants