1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-04 21:23:12 +02:00

- Fixed bug reported by mut80r (#0003867) where locops didn't get a

proper vhost when set::hosts::local had a 'user@host' syntax instead of
  just 'host'. Also fixed a bug with regards to +x on-oper with locops.
This commit is contained in:
Bram Matthys
2009-11-22 13:34:12 +00:00
parent e92e2c22c3
commit 2ed84ed506
2 changed files with 26 additions and 16 deletions
+3
View File
@@ -1804,3 +1804,6 @@
Note that modifying an incoming message by the hook is not supported.
- Applied patch from ohnobinki (#0003863) which makes run-time configuration
of files (tune, pid, motd) possible.
- Fixed bug reported by mut80r (#0003867) where locops didn't get a
proper vhost when set::hosts::local had a 'user@host' syntax instead of
just 'host'. Also fixed a bug with regards to +x on-oper with locops.
+23 -16
View File
@@ -143,6 +143,23 @@ DLLFUNC int MOD_UNLOAD(m_oper)(int module_unload)
return MOD_SUCCESS;
}
void set_oper_host(aClient *sptr, char *host)
{
char *c;
char *vhost = host;
if ((c = strchr(host, '@')))
{
vhost = c+1;
strncpy(sptr->user->username, host, c-host);
sptr->user->username[c-host] = 0;
sendto_serv_butone_token(NULL, sptr->name, MSG_SETIDENT,
TOK_SETIDENT, "%s",
sptr->user->username);
}
iNAH_host(sptr, vhost);
SetHidden(sptr);
}
/*
** m_oper
@@ -275,20 +292,7 @@ DLLFUNC int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
sptr->oflag = aconf->oflags;
if ((aconf->oflags & OFLAG_HIDE) && iNAH && !BadPtr(host)) {
char *c;
char *vhost = host;
if ((c = strchr(host, '@')))
{
vhost = c+1;
strncpy(sptr->user->username, host, c-host);
sptr->user->username[c-host] = 0;
sendto_serv_butone_token(NULL, sptr->name, MSG_SETIDENT,
TOK_SETIDENT, "%s",
sptr->user->username);
}
iNAH_host(sptr, vhost);
SetHidden(sptr);
set_oper_host(sptr, host);
} else
if (IsHidden(sptr) && !sptr->user->virthost) {
/* +x has just been set by modes-on-oper and iNAH is off */
@@ -299,8 +303,11 @@ DLLFUNC int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
{
sptr->umodes |= UMODE_LOCOP;
if ((aconf->oflags & OFLAG_HIDE) && iNAH && !BadPtr(locop_host)) {
iNAH_host(sptr, locop_host);
SetHidden(sptr);
set_oper_host(sptr, locop_host);
} else
if (IsHidden(sptr) && !sptr->user->virthost) {
/* +x has just been set by modes-on-oper and iNAH is off */
sptr->user->virthost = strdup(sptr->user->cloakedhost);
}
sendto_snomask(SNO_OPER, "%s (%s@%s) is now a local operator (o)",
parv[0], sptr->user->username, GetHost(sptr));