Browse Source

fix #1722

Validate operator vhosts against the configured (or default)
vhosts.valid-regexp
tags/v2.8.0-rc1
Shivaram Lingamneni 2 years ago
parent
commit
0751f31b9e
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      irc/config.go

+ 3
- 0
irc/config.go View File

@@ -830,6 +830,9 @@ func (conf *Config) Operators(oc map[string]*OperClass) (map[string]*Oper, error
830 830
 		}
831 831
 
832 832
 		oper.Vhost = opConf.Vhost
833
+		if oper.Vhost != "" && !conf.Accounts.VHosts.validRegexp.MatchString(oper.Vhost) {
834
+			return nil, fmt.Errorf("Oper %s has an invalid vhost: `%s`", name, oper.Vhost)
835
+		}
833 836
 		class, exists := oc[opConf.Class]
834 837
 		if !exists {
835 838
 			return nil, fmt.Errorf("Could not load operator [%s] - they use operclass [%s] which does not exist", name, opConf.Class)

Loading…
Cancel
Save