irc: Fix authentication issues
patch eabdad37e130b538e49cd13fb3efd211db457e18
Author: E. Bosch <presidev@AT@gmail.com>
Date: Sat Jan 22 22:08:56 CET 2022
* irc: Fix authentication issues
diff -rN -u old-irgramd/irc.py new-irgramd/irc.py
--- old-irgramd/irc.py 2024-11-22 16:28:05.324142306 +0100
+++ new-irgramd/irc.py 2024-11-22 16:28:05.324142306 +0100
@@ -155,7 +155,7 @@
elif ni in self.users.keys():
await self.reply_code(user, 'ERR_NICKNAMEINUSE', (nick,), '*')
elif user.pam_auth(nick, self.conf['pam'], self.conf['pam_group'], user.recv_pass) \
- or user.local_auth(nick, self.conf['irc_nicks'], user.recv_pass, self.conf['irc_password']):
+ or user.local_auth(nick, self.conf['irc_nicks'], user.recv_pass, self.conf['irc_password'], self.conf['pam']):
if user.registered:
# rename
current = user.irc_nick.lower()
@@ -560,8 +560,6 @@
except:
check_group = False
if not check_group: return False
- else:
- check_group = True
# Check user authentication (via PAM)
import PAM
@@ -581,7 +579,8 @@
else:
return True
- def local_auth(self, nick, nicks, recv_pass, irc_pass):
- return ( nick in nicks
+ def local_auth(self, nick, nicks, recv_pass, irc_pass, pam):
+ return ( not pam
+ and nick in nicks
and recv_pass == irc_pass
)