aboutsummaryrefslogtreecommitdiffstats
path: root/root_commands.c
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-09-11 19:07:10 -0300
committerdequis <dx@dxzone.com.ar>2015-10-08 05:34:18 -0300
commit58b63de6f1dd84a4923c623dafd548512ecdf054 (patch)
treec6ded487de0a9538b412819b3f24f6925a3c1135 /root_commands.c
parent2f736927554d588d00d31f367cd07b9845036e09 (diff)
IRCv3 SASL capability + PLAIN method
Only plain, no other methods. We don't have built-in SSL to implement EXTERNAL (certfp) and nothing else is worth implementing. The actual authentication is pretty much like sending a server password (when the server's authmode isn't closed), which means it happens in cmd_identify, but this code also calls storage_check_pass() to send the required success/failure replies. SASL doesn't give us much benefit other than standards compliance, but some clients might appreciate it. And having a fifth way to do the same thing doesn't hurt! Now we have: - identify in &bitlbee - identify to nickserv (alias for root) - 'nickserv' and 'ns' irc commands - server password - sasl plain
Diffstat (limited to 'root_commands.c')
-rw-r--r--root_commands.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/root_commands.c b/root_commands.c
index 7e1dc2a7..b5d0aef1 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -162,6 +162,12 @@ static void cmd_identify(irc_t *irc, char **cmd)
irc->status |= USTATUS_IDENTIFIED;
irc_umode_set(irc, "+R", 1);
+ if (irc->caps & CAP_SASL) {
+ irc_user_t *iu = irc->user;
+ irc_send_num(irc, 900, "%s!%s@%s %s :You are now logged in as %s",
+ iu->nick, iu->user, iu->host, iu->nick, iu->nick);
+ }
+
bitlbee_whatsnew(irc);
/* The following code is a bit hairy now. With takeover
@@ -238,6 +244,12 @@ static void cmd_register(irc_t *irc, char **cmd)
irc->status |= USTATUS_IDENTIFIED;
irc_umode_set(irc, "+R", 1);
+ if (irc->caps & CAP_SASL) {
+ irc_user_t *iu = irc->user;
+ irc_send_num(irc, 900, "%s!%s@%s %s :You are now logged in as %s",
+ iu->nick, iu->user, iu->host, iu->nick, iu->nick);
+ }
+
/* Set this var now, or anyone who logs in to his/her
newly created account for the first time gets the
whatsnew story. */