|
@@ -505,9 +505,9 @@ type Config struct {
|
505
|
505
|
STS STSConfig
|
506
|
506
|
LookupHostnames *bool `yaml:"lookup-hostnames"`
|
507
|
507
|
lookupHostnames bool
|
508
|
|
- ForwardConfirmHostnames bool `yaml:"forward-confirm-hostnames"`
|
509
|
|
- CheckIdent bool `yaml:"check-ident"`
|
510
|
|
- SuppressIdent bool `yaml:"suppress-ident"`
|
|
508
|
+ ForwardConfirmHostnames bool `yaml:"forward-confirm-hostnames"`
|
|
509
|
+ CheckIdent bool `yaml:"check-ident"`
|
|
510
|
+ CoerceIdent string `yaml:"coerce-ident"`
|
511
|
511
|
MOTD string
|
512
|
512
|
motdLines []string
|
513
|
513
|
MOTDFormatting bool `yaml:"motd-formatting"`
|
|
@@ -913,8 +913,16 @@ func LoadConfig(filename string) (config *Config, err error) {
|
913
|
913
|
}
|
914
|
914
|
}
|
915
|
915
|
|
916
|
|
- if config.Server.CheckIdent && config.Server.SuppressIdent {
|
917
|
|
- return nil, errors.New("Can't configure both check-ident and suppress-ident")
|
|
916
|
+ if config.Server.CoerceIdent != "" {
|
|
917
|
+ if config.Server.CheckIdent {
|
|
918
|
+ return nil, errors.New("Can't configure both check-ident and coerce-ident")
|
|
919
|
+ }
|
|
920
|
+ if config.Server.CoerceIdent[0] != '~' {
|
|
921
|
+ return nil, errors.New("coerce-ident value must start with a ~")
|
|
922
|
+ }
|
|
923
|
+ if !isIdent(config.Server.CoerceIdent[1:]) {
|
|
924
|
+ return nil, errors.New("coerce-ident must be valid as an IRC user/ident field")
|
|
925
|
+ }
|
918
|
926
|
}
|
919
|
927
|
|
920
|
928
|
config.Server.supportedCaps = caps.NewCompleteSet()
|