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 gateway name field for auth blocks #273

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

examknow
Copy link
Contributor

@examknow examknow commented Sep 2, 2021

Closes #213.

@examknow examknow marked this pull request as draft September 2, 2021 01:45
@examknow examknow marked this pull request as ready for review August 30, 2022 22:27
@TheDaemoness
Copy link
Contributor

Oops, I seem to have sniped extban g from under you. 😁

progval suggested w; IMO that's probably the best alternative. It might also be a good idea to change the WHOX field name for consistency?

Since the creation of this PR, a new module was introduced using
the extban char `g`, creating an unforseen conflict. This commit
changes that character to `w` to match the char used in inspircd
Copy link
Contributor

@phy1729 phy1729 left a comment

Choose a reason for hiding this comment

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

A couple of places could add a const (cap_gateway_desc, struct Client's gateway, and struct ConfItem's gateway), but there doesn't seem to be a consistent style either way.

Comment on lines +22 to +24
#include <capability.h>
#include <s_serv.h>
#include <s_newconf.h>
Copy link
Contributor

@phy1729 phy1729 Jul 6, 2023

Choose a reason for hiding this comment

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

I don't think these are necessary (MAPI_CAP_CLIENT is defined in modules.h).

Comment on lines +50 to +53
/* $w by itself will match all gateway users */
if (data == NULL)
return EmptyString(client_p->gateway) ? EXTBAN_NOMATCH : EXTBAN_MATCH;
return match(data, client_p->gateway) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
Copy link
Contributor

Choose a reason for hiding this comment

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

match seems to expect the second argument to be non NULL. I think this should be something like

	if EmptyString(client_p->gateway)
		return EXTBAN_NOMATCH;
	/* $w by itself will match all gateway users */
	if (data == NULL)
		return EXTBAN_MATCH;
	return match(data, client_p->gateway) ? EXTBAN_MATCH : EXTBAN_NOMATCH;

@@ -565,6 +568,21 @@ do_who(struct Client *source_p, struct Client *target_p, struct membership *mspt
q = "0";
append_format(str, sizeof str, &pos, " %s", q);
}
if (fmt->fields & FIELD_GATEWAY)
{
/* use same the logic as account */
Copy link
Contributor

Choose a reason for hiding this comment

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

Given the reasoning for account to do this 1, I don't think it makes sense to copy that logic for gateway.

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.

add "gateway name" field set by auth blocks and an extban that matches it
3 participants