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

Add on_auth_fail callback #7039

Merged
merged 1 commit into from Feb 15, 2018
Merged

Conversation

red-001
Copy link
Contributor

@red-001 red-001 commented Feb 13, 2018

Called when a client fails to supply the correct password for the account it's attempting to login as.

@nerzhul nerzhul added this to the 0.5.0 milestone Feb 13, 2018
Copy link
Member

@nerzhul nerzhul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay for me

doc/lua_api.txt Outdated
@@ -2615,6 +2615,10 @@ Call these functions only at load time!
* `minetest.register_on_leaveplayer(func(ObjectRef, timed_out))`
* Called when a player leaves the game
* `timed_out`: True for timeout, false for other reasons.
* `minetest.register_on_auth_fail(func(ip, name))`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use name, ip as in minetest.register_on_prejoinplayer(func(name, ip))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@SmallJoker
Copy link
Member

What are the use cases of this callback? Network delays make it quite hard to crack a password of users, if that's what you would like to prevent.

@paramat
Copy link
Contributor

paramat commented Feb 13, 2018

Yes please i'd like to know why this is needed.

@sofar
Copy link
Contributor

sofar commented Feb 14, 2018

Possible use: Telling useRs that someone from another IP address was attempting to log in the account, which helps in maintaining legitimate bans for IP addresses.

@red-001
Copy link
Contributor Author

red-001 commented Feb 14, 2018

Like sofar said it allows informing users that someone was trying to access their account and while cracking even a mediocre password should be next to impossible over the network, a lot of users do use weak passwords. Plus if someone did just forget their password it allows informing them of any password reset system the server might have.

@sofar
Copy link
Contributor

sofar commented Feb 15, 2018

I am the author of tallow which is something similar to fail2ban. Essentially, having this callback could enable the very same thing, and solutions like this are reasonable. Without this call, people have to resort to much more complex methods.

@red-001 red-001 force-pushed the on_auth_failure branch 3 times, most recently from 37183b3 to 95fd78a Compare February 15, 2018 13:37
Called when a client fails to supply the correct password for the account it's attempting to login as.
Copy link
Member

@SmallJoker SmallJoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SmallJoker SmallJoker merged commit 338d645 into minetest:master Feb 15, 2018
@red-001 red-001 deleted the on_auth_failure branch February 16, 2018 13:04
minduser00 pushed a commit to minduser00/minetest that referenced this pull request Mar 18, 2018
Called when a client fails to supply the correct password for the account it's attempting to login as.
minduser00 pushed a commit to minduser00/minetest that referenced this pull request Mar 18, 2018
Called when a client fails to supply the correct password for the account it's attempting to login as.
osjc pushed a commit to osjc/minetest that referenced this pull request Jan 11, 2019
Called when a client fails to supply the correct password for the account it's attempting to login as.
osjc pushed a commit to osjc/minetest that referenced this pull request Jan 23, 2019
Called when a client fails to supply the correct password for the account it's attempting to login as.
mckaygerhard added a commit to minenux/minetest-engine that referenced this pull request Nov 2, 2021
* Called when client fails to supply correct password it's attempting to login as.
* the patch from sorceredkid
* backported minetest#7039
* based on https://forum.minetest.net/viewtopic.php?p=329245#p329245
* USAGE: Telling useRs that someone from another IP address was attempting to log in
* HELPS: which helps in maintaining legitimate bans for IP addresses
* IMPROVEMENTS:
    * if someone did just forget their password it allows informing them of
      any password reset system the server might have.
    * having this callback could enable the very same thing, and solutions like
      this are reasonable.
* this improvement is backported from 5.0.0 (it seems removed in 5.3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants