mirror of
https://github.com/anope/anope.git
synced 2026-06-13 02:54:46 +02:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 15f5be76b9 | |||
| 12f1ebee1c | |||
| 8e691eac80 | |||
| 2327c6ac9a | |||
| e23ea8f8ea | |||
| 449cfa6503 | |||
| 01fc7421b6 | |||
| e6d7306202 | |||
| 2107d18d9e | |||
| acb9428635 | |||
| 27a19dcc52 |
@@ -24,3 +24,17 @@ I have tested this pull request on:
|
||||
|
||||
**Operating system name and version:** <!-- e.g. Linux 3.11 -->
|
||||
**Compiler name and version:** <!-- e.g. GCC 4.2.0 -->
|
||||
|
||||
## Checks
|
||||
|
||||
<!--
|
||||
Tick the boxes for the checks you have made.
|
||||
-->
|
||||
|
||||
I have ensured that:
|
||||
|
||||
- [ ] The code I am submitting is my own work and/or I have permission from the author to share it.
|
||||
- [ ] Generative AI (Copilot, ChatGPT, etc) was not used to create any part of this pull request.
|
||||
- [ ] If the pull request contains a security fix I have followed the reporting rules mentioned in [the security policy](https://github.com/anope/anope/security/policy) (delete if not applicable).
|
||||
- [ ] I have documented any features added by this pull request (delete if not applicable).
|
||||
- [ ] This pull request does not introduce any incompatible API changes (stable branches only, delete if not applicable).
|
||||
|
||||
@@ -12,39 +12,49 @@ Charles Kingsley <chaz@anope.org>
|
||||
Charles Kingsley <chaz@anope.org> <sjaz@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Cronus <cronus@nite-serv.com>
|
||||
Daniel Engel <dane@zero.org> <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
David Robson <rob@anope.org> <robbeh@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
David Robson <rob@anope.org> <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
David Robson <rob@anope.org> <robbeh@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Dennis Friis <peavey@inspircd.org> <peavey peavey@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Fabio Scotoni <cculex@gmail.com>
|
||||
Filippo Cortigiani <simos@simosnap.org> <devel@devel.crtnet.it>
|
||||
Filippo Cortigiani <simos@simosnap.org> <simos@H7-25.fritz.box>
|
||||
Florian Schulze <certus@anope.org> <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Gabriel Acevedo H. <drstein@anope.org> <drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Harakiri <harakiri@overstack.fr>
|
||||
Hendrik Jäger <gitcommit@henk.geekmail.org> <github@henk.geekmail.org>
|
||||
Jan Milants <viper@anope.org>
|
||||
Jan Milants <viper@anope.org> <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Jan Milants <viper@anope.org> <viper viper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Jens Voss <dukepyrolator@anope.org> <anope@s15355730.onlinehome-server.info>
|
||||
Jens Voss <dukepyrolator@anope.org> <DukePyrolator@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Jens Voss <dukepyrolator@anope.org> <DukePyrolator@anope.org>
|
||||
Jens Voss <dukepyrolator@anope.org> Jens VoĂź <jens@pyrobook.(none)>
|
||||
Jens Voss <dukepyrolator@anope.org> <jens@pyrobook.(none)>
|
||||
k4be <k4be@pirc.pl> <34816207+k4bek4be@users.noreply.github.com>
|
||||
Lee Holmes <lethality@anope.org>
|
||||
Lee Holmes <lethality@anope.org> <lee@lethality.me.uk>
|
||||
Mark Summers <mark@goopler.net> <mark mark@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Matt Schatz <genius3000@g3k.solutions>
|
||||
Matt Ullman <matt@airraidsirens.com> <blindsight@gamesurge.net>
|
||||
Michael Hazell <michaelhazell@hotmail.com> <Techman-@users.noreply.github.com>
|
||||
Michael Stapelberg <michael@robustirc.net> <stapelberg@users.noreply.github.com>
|
||||
Michael Wobst <wobst.michael@web.de>
|
||||
Michael Wobst <wobst.michael@web.de> <michael@static.163.129.251.148.clients.your-server.de>
|
||||
Michael Wobst <wobst.michael@web.de> <michael@wobst.at>
|
||||
Naram Qashat <cyberbotx@anope.org> <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Naram Qashat <cyberbotx@anope.org> <cyberbotx@cyberbotx.com>
|
||||
Naram Qashat <cyberbotx@anope.org> <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
PeGaSuS <droider.pc@gmail.com>
|
||||
PeGaSuS <droider.pc@gmail.com> <25697531+TehPeGaSuS@users.noreply.github.com>
|
||||
Pieter Bootsma <geniusdex@anope.org> <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Robby <robby@chatbelgie.be> <robby@anope.org>
|
||||
Robby <robby@chatbelgie.be> <robby@chat.be>
|
||||
Robert Scheck <robert@fedoraproject.org> <robert-scheck@users.noreply.github.com>
|
||||
Robin Burchell <w00t@inspircd.org> <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Robin Burchell <w00t@inspircd.org> <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Sadie Powell <sadie@witchery.services> Peter Powell <petpow@saberuk.com>
|
||||
Sadie Powell <sadie@sadiepowell.dev> <petpow@saberuk.com>
|
||||
Sadie Powell <sadie@sadiepowell.dev> <sadie@witchery.services>
|
||||
Sebastian Barfurth <github@afreshmelon.com>
|
||||
Sebastian V. <hal9000@denorastats.org>
|
||||
Sebastian V. <hal9000@denorastats.org> <pimpmylinux@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Trystan S. Lee <trystan@nomadirc.net> <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Val Lorentz <progval+git@progval.net> <progval+git@progval.net>
|
||||
|
||||
+9
-1
@@ -1,7 +1,15 @@
|
||||
Anope Version 2.0.19-git
|
||||
Anope Version 2.0.21-git
|
||||
------------------------
|
||||
No significant changes.
|
||||
|
||||
Anope Version 2.0.20
|
||||
--------------------
|
||||
Fixed an escaped value that wasn't escaped enough in chanstats.
|
||||
Fixed not having a handler for the FNAME message on InspIRCd.
|
||||
Fixed os_stats reporting the SGLine expiry time as the SQLine expiry time.
|
||||
Fixed the DNs and search filters not being escaped correctly in the ldap_authentication and ldap_oper modules.
|
||||
Modernised the advice in docs/LANGUAGE regarding the installation of language packs.
|
||||
|
||||
Anope Version 2.0.19
|
||||
--------------------
|
||||
Added a Doxygen config file.
|
||||
|
||||
+5
-1
@@ -1,7 +1,11 @@
|
||||
Anope Version 2.0.20-git
|
||||
Anope Version 2.0.21-git
|
||||
------------------------
|
||||
No significant changes.
|
||||
|
||||
Anope Version 2.0.20
|
||||
--------------------
|
||||
No significant changes.
|
||||
|
||||
Anope Version 2.0.19
|
||||
--------------------
|
||||
No significant changes.
|
||||
|
||||
+3
-9
@@ -10,14 +10,9 @@ Anope Multi Language Support
|
||||
|
||||
To build Anope with gettext support, gettext and its development libraries must be installed on the system.
|
||||
|
||||
On Debian install the locales-all package.
|
||||
On Debian-based systems install the locales-all package.
|
||||
|
||||
On Ubuntu run locale-gen for each language you want to enable.
|
||||
For example:
|
||||
locale-gen es_ES.UTF-8
|
||||
|
||||
Then execute:
|
||||
dpkg-reconfigure locales
|
||||
On RHEL-based systems run `yum list glibc-langpack-*` and install the languages you want to enable.
|
||||
|
||||
If you have already built Anope you will need to delete the build directory and rebuild from scratch.
|
||||
|
||||
@@ -34,8 +29,7 @@ Anope Multi Language Support
|
||||
Poedit (https://poedit.net/) is a popular po file editor, and we recommend using it or another editor designed to edit
|
||||
po files (especially on Windows).
|
||||
|
||||
If you have finished a language file translation and you want others to use it, please file a pull request on GitHub
|
||||
or send it to team@anope.org (don't forget to mention clearly your (nick)name, your email and the language name).
|
||||
If you have finished a language file translation and you want others to use it, please file a pull request on GitHub.
|
||||
You'll of course get full credit for it.
|
||||
|
||||
3) Using languages with modules
|
||||
|
||||
@@ -166,6 +166,16 @@ class LDAPProvider : public Service
|
||||
* @param attributes The attributes to modify
|
||||
*/
|
||||
virtual void Modify(LDAPInterface *i, const Anope::string &base, LDAPMods &attributes) = 0;
|
||||
|
||||
/** Escapes a LDAP string for use in a DN.
|
||||
* @param str The string to escape.
|
||||
*/
|
||||
virtual Anope::string EscapeDN(const Anope::string &str) const = 0;
|
||||
|
||||
/** Escapes a LDAP string for use in a search filter.
|
||||
* @param str The string to escape.
|
||||
*/
|
||||
virtual Anope::string EscapeSF(const Anope::string &str) const = 0;
|
||||
};
|
||||
|
||||
#endif // ANOPE_LDAP_H
|
||||
|
||||
@@ -9,7 +9,7 @@ msgstr ""
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-12-17 19:24+0000\n"
|
||||
"PO-Revision-Date: 2023-12-17 19:27+0000\n"
|
||||
"Last-Translator: Sadie Powell <sadie@witchery.services>\n"
|
||||
"Last-Translator: Sadie Powell <sadie@sadiepowell.dev>\n"
|
||||
"Language-Team: English\n"
|
||||
"Language: en_US\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
||||
@@ -388,6 +388,80 @@ class LDAPService : public LDAPProvider, public Thread, public Condition
|
||||
QueueRequest(mod);
|
||||
}
|
||||
|
||||
Anope::string EscapeDN(const Anope::string &str) const anope_override
|
||||
{
|
||||
if (str.empty())
|
||||
return str;
|
||||
|
||||
Anope::string newstr;
|
||||
newstr.str().reserve(str.length());
|
||||
for (size_t idx = 0; idx < str.length(); ++idx)
|
||||
{
|
||||
const char chr = str[idx];
|
||||
if (chr == '\0')
|
||||
{
|
||||
newstr.append("\\00");
|
||||
}
|
||||
else if (chr == '"' || chr == '+' || chr == ',' || chr == ';' ||
|
||||
chr == '<' || chr == '=' || chr == '>' || chr == '\\')
|
||||
{
|
||||
newstr.push_back('\\');
|
||||
newstr.push_back(chr);
|
||||
}
|
||||
else if (idx == 0 && (chr == '#' || chr == ' '))
|
||||
{
|
||||
newstr.push_back('\\');
|
||||
newstr.push_back(chr);
|
||||
}
|
||||
else if (idx == str.length() - 1 && chr == ' ')
|
||||
{
|
||||
newstr.push_back('\\');
|
||||
newstr.push_back(chr);
|
||||
}
|
||||
else
|
||||
{
|
||||
newstr.push_back(chr);
|
||||
}
|
||||
}
|
||||
|
||||
return newstr;
|
||||
}
|
||||
|
||||
Anope::string EscapeSF(const Anope::string &str) const anope_override
|
||||
{
|
||||
if (str.empty())
|
||||
return str;
|
||||
|
||||
Anope::string newstr;
|
||||
newstr.str().reserve(str.length());
|
||||
for (size_t idx = 0; idx < str.length(); ++idx)
|
||||
{
|
||||
const char chr = str[idx];
|
||||
switch (chr)
|
||||
{
|
||||
case '\0':
|
||||
newstr.append("\\00");
|
||||
break;
|
||||
case '(':
|
||||
newstr.append("\\28");
|
||||
break;
|
||||
case ')':
|
||||
newstr.append("\\29");
|
||||
break;
|
||||
case '*':
|
||||
newstr.append("\\2A");
|
||||
break;
|
||||
case '\\':
|
||||
newstr.append("\\5C");
|
||||
break;
|
||||
default:
|
||||
newstr.push_back(chr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return newstr;
|
||||
}
|
||||
|
||||
private:
|
||||
void BuildReply(int res, LDAPRequest *req)
|
||||
{
|
||||
|
||||
@@ -84,7 +84,9 @@ class IdentifyInterface : public LDAPInterface
|
||||
{
|
||||
if (ii->admin_bind)
|
||||
{
|
||||
Anope::string sf = search_filter.replace_all_cs("%account", ii->req->GetAccount()).replace_all_cs("%object_class", object_class);
|
||||
Anope::string sf = search_filter
|
||||
.replace_all_cs("%account", ii->lprov->EscapeSF(ii->req->GetAccount()))
|
||||
.replace_all_cs("%object_class", object_class);
|
||||
try
|
||||
{
|
||||
Log(LOG_DEBUG) << "m_ldap_authentication: searching for " << sf;
|
||||
@@ -296,7 +298,7 @@ class ModuleLDAPAuthentication : public Module
|
||||
attributes[3].name = this->password_attribute;
|
||||
attributes[3].values.push_back(pass);
|
||||
|
||||
Anope::string new_dn = username_attribute + "=" + na->nick + "," + basedn;
|
||||
Anope::string new_dn = username_attribute + "=" + this->ldap->EscapeDN(na->nick) + "," + basedn;
|
||||
this->ldap->Add(&this->orinterface, new_dn, attributes);
|
||||
}
|
||||
|
||||
|
||||
@@ -115,8 +115,12 @@ class LDAPOper : public Module
|
||||
throw LDAPException("Could not search LDAP for opertype settings, invalid configuration.");
|
||||
|
||||
if (!this->binddn.empty())
|
||||
this->ldap->Bind(NULL, this->binddn.replace_all_cs("%a", u->Account()->display), this->password.c_str());
|
||||
this->ldap->Search(new IdentifyInterface(this, u), this->basedn, this->filter.replace_all_cs("%a", u->Account()->display));
|
||||
{
|
||||
Anope::string bdn = this->binddn.replace_all_cs("%a", this->ldap->EscapeDN(u->Account()->display));
|
||||
this->ldap->Bind(NULL, bdn, this->password.c_str());
|
||||
}
|
||||
Anope::string af = this->filter.replace_all_cs("%a", this->ldap->EscapeSF(u->Account()->display));
|
||||
this->ldap->Search(new IdentifyInterface(this, u), this->basedn, af);
|
||||
}
|
||||
catch (const LDAPException &ex)
|
||||
{
|
||||
|
||||
@@ -343,14 +343,16 @@ class MChanstats : public Module
|
||||
"(nick_, '', 'total'), (nick_, '', 'monthly'),"
|
||||
"(nick_, '', 'weekly'), (nick_, '', 'daily');"
|
||||
"END IF;"
|
||||
"SET @echan = chan_;"
|
||||
"SET @enick = nick_;"
|
||||
"SET @update_query = CONCAT('UPDATE `" + prefix + "chanstats` SET line=line+', line_, ',"
|
||||
"letters=letters+', letters_, ' , words=words+', words_, ', actions=actions+', actions_, ', "
|
||||
"smileys_happy=smileys_happy+', sm_h_, ', smileys_sad=smileys_sad+', sm_s_, ', "
|
||||
"smileys_other=smileys_other+', sm_o_, ', kicks=kicks+', kicks_, ', kicked=kicked+', kicked_, ', "
|
||||
"modes=modes+', modes_, ', topics=topics+', topics_, ', ', time_ , '=', time_, '+', line_ ,' "
|
||||
"WHERE (nick='''' OR nick=''', nick_, ''') AND (chan='''' OR chan=''', chan_, ''')');"
|
||||
"WHERE (nick='''' OR nick=?) AND (chan='''' OR chan=?)');"
|
||||
"PREPARE update_query FROM @update_query;"
|
||||
"EXECUTE update_query;"
|
||||
"EXECUTE update_query using @enick, @echan;"
|
||||
"DEALLOCATE PREPARE update_query;"
|
||||
"END";
|
||||
this->RunQuery(query);
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
|
||||
VERSION_MAJOR=2
|
||||
VERSION_MINOR=0
|
||||
VERSION_PATCH=20
|
||||
VERSION_PATCH=21
|
||||
VERSION_EXTRA="-git"
|
||||
|
||||
Reference in New Issue
Block a user