feat: add username/hostname support with IRC hostmask format #82

Open
clawbot wants to merge 6 commits from feature/username-hostname-support into main
Showing only changes of commit 427ee1e820 - Show all commits

View File

@@ -2,6 +2,7 @@ package handlers
import (
"context"
"crypto/subtle"
"encoding/json"
"fmt"
"net"
@@ -2822,7 +2823,8 @@ func (hdlr *Handlers) handleOper(
cfgPass := hdlr.params.Config.OperPassword
if cfgName == "" || cfgPass == "" ||
operName != cfgName || operPass != cfgPass {
subtle.ConstantTimeCompare([]byte(operName), []byte(cfgName)) != 1 ||
subtle.ConstantTimeCompare([]byte(operPass), []byte(cfgPass)) != 1 {
hdlr.enqueueNumeric(
ctx, clientID, irc.ErrNoOperHost, nick,
nil, "No O-lines for your host",