Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
8e5bab52
Commit
8e5bab52
authored
1 year ago
by
Randy Sommerfeld
Browse files
Options
Downloads
Patches
Plain Diff
Allow commas in Mask= for .ini configs
parent
727ad405
No related branches found
No related tags found
1 merge request
!463
MRC mods by Codefenix (2024-10-20)
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
exec/load/ircd/config.js
+80
-42
80 additions, 42 deletions
exec/load/ircd/config.js
exec/load/ircd/core.js
+3
-3
3 additions, 3 deletions
exec/load/ircd/core.js
with
83 additions
and
45 deletions
exec/load/ircd/config.js
+
80
−
42
View file @
8e5bab52
...
@@ -250,8 +250,8 @@ function ini_sections() {
...
@@ -250,8 +250,8 @@ function ini_sections() {
}
}
function
ini_Info
(
arg
,
ini
)
{
function
ini_Info
(
arg
,
ini
)
{
if
(
ini
.
Server
N
ame
)
if
(
ini
.
Server
n
ame
)
ServerName
=
ini
.
Server
N
ame
;
ServerName
=
ini
.
Server
n
ame
;
if
(
ini
.
Description
)
if
(
ini
.
Description
)
ServerDesc
=
ini
.
Description
;
ServerDesc
=
ini
.
Description
;
if
(
ini
.
Admin1
)
if
(
ini
.
Admin1
)
...
@@ -305,12 +305,13 @@ function ini_Class(arg, ini) {
...
@@ -305,12 +305,13 @@ function ini_Class(arg, ini) {
/* Former I:Line */
/* Former I:Line */
function
ini_Allow
(
arg
,
ini
)
{
function
ini_Allow
(
arg
,
ini
)
{
var
ircclass
;
var
ircclass
,
masks
,
i
;
if
(
!
ini
.
Mask
.
match
(
"
[@]
"
))
{
if
(
!
ini
.
Mask
)
{
log
(
LOG_WARNING
,
log
(
LOG_WARNING
,
format
(
"
!WARNING Malformed mask in Allow section. Proper format is user@hostname but usually *@*
"
"
!WARNING No mask found in [Allow:%s], ignoring this section.
"
,
);
arg
))
return
;
return
;
}
}
...
@@ -323,18 +324,30 @@ function ini_Allow(arg, ini) {
...
@@ -323,18 +324,30 @@ function ini_Allow(arg, ini) {
ircclass
=
0
;
ircclass
=
0
;
}
}
ILines
[
arg
]
=
new
ILine
(
masks
=
ini
.
Mask
.
split
(
"
,
"
);
ini
.
Mask
,
for
(
i
in
masks
)
{
if
(
!
masks
[
i
].
match
(
"
[@]
"
))
{
log
(
LOG_WARNING
,
format
(
"
!WARNING Malformed mask in [Allow:%s]: %s. Ignoring.
"
,
arg
,
masks
[
i
]
));
continue
;
}
ILines
.
push
(
new
ILine
(
masks
[
i
],
null
,
/* password */
null
,
/* password */
ini
.
Mask
,
/* hostmask */
masks
[
i
]
,
/* hostmask */
null
,
/* port */
null
,
/* port */
ircclass
ircclass
);
));
}
}
}
/* Former O:Line */
/* Former O:Line */
function
ini_Operator
(
arg
,
ini
)
{
function
ini_Operator
(
arg
,
ini
)
{
var
ircclass
;
var
ircclass
,
masks
,
i
;
if
(
!
ini
.
Nick
||
!
ini
.
Mask
||
!
ini
.
Password
||
!
ini
.
Flags
||
!
ini
.
Class
)
{
if
(
!
ini
.
Nick
||
!
ini
.
Mask
||
!
ini
.
Password
||
!
ini
.
Flags
||
!
ini
.
Class
)
{
log
(
LOG_WARNING
,
format
(
log
(
LOG_WARNING
,
format
(
...
@@ -361,27 +374,39 @@ function ini_Operator(arg, ini) {
...
@@ -361,27 +374,39 @@ function ini_Operator(arg, ini) {
ircclass
=
0
;
ircclass
=
0
;
}
}
masks
=
ini
.
Mask
.
split
(
"
,
"
);
for
(
i
in
masks
)
{
if
(
!
masks
[
i
].
match
(
"
[@]
"
))
{
log
(
LOG_WARNING
,
format
(
"
!WARNING Malformed mask in [Operator:%s] %s. Ignored.
"
,
arg
,
masks
[
i
]
));
continue
;
}
OLines
.
push
(
new
OLine
(
OLines
.
push
(
new
OLine
(
ini
.
Mask
,
masks
[
i
]
,
ini
.
Password
,
ini
.
Password
,
ini
.
Nick
,
ini
.
Nick
,
parse_oline_flags
(
ini
.
Flags
),
parse_oline_flags
(
ini
.
Flags
),
ircclass
ircclass
));
));
}
return
;
return
;
}
}
/* Former U:Line */
/* Former U:Line */
function
ini_Services
(
arg
,
ini
)
{
function
ini_Services
(
arg
,
ini
)
{
if
(
ini
.
Server
)
if
(
ini
.
Server
name
)
ULines
.
push
(
ini
.
Server
);
ULines
.
push
(
ini
.
Server
name
);
return
;
return
;
}
}
/* Former K:Line & Z:Line */
/* Former K:Line & Z:Line */
function
ini_Ban
(
arg
,
ini
)
{
function
ini_Ban
(
arg
,
ini
)
{
var
kline_mask
;
var
kline_mask
,
masks
,
i
;
if
(
!
ini
.
Mask
)
{
if
(
!
ini
.
Mask
)
{
log
(
LOG_WARNING
,
format
(
log
(
LOG_WARNING
,
format
(
...
@@ -391,13 +416,18 @@ function ini_Ban(arg, ini) {
...
@@ -391,13 +416,18 @@ function ini_Ban(arg, ini) {
return
;
return
;
}
}
kline_mask
=
create_ban_mask
(
ini
.
Mask
,
true
/* kline */
);
masks
=
ini
.
Mask
.
split
(
"
,
"
);
for
(
i
in
masks
)
{
kline_mask
=
create_ban_mask
(
masks
[
i
],
true
/* kline */
);
if
(
!
kline_mask
)
{
if
(
!
kline_mask
)
{
log
(
LOG_WARNING
,
format
(
log
(
LOG_WARNING
,
format
(
"
!WARNING Invalid ban mask %s Ignoring.
"
,
"
!WARNING Invalid ban mask in [Ban:%s] %s Ignoring.
"
,
ini
.
Mask
arg
,
masks
[
i
]
));
));
return
;
continue
;
}
}
KLines
.
push
(
new
KLine
(
KLines
.
push
(
new
KLine
(
...
@@ -406,6 +436,7 @@ function ini_Ban(arg, ini) {
...
@@ -406,6 +436,7 @@ function ini_Ban(arg, ini) {
"
K
"
/* ban type: K, A, or Z. */
"
K
"
/* ban type: K, A, or Z. */
));
));
}
}
}
/* Former H:Line */
/* Former H:Line */
/* Servermasks are deprecated */
/* Servermasks are deprecated */
...
@@ -467,6 +498,8 @@ function ini_Server(arg, ini) {
...
@@ -467,6 +498,8 @@ function ini_Server(arg, ini) {
/* Former Q:Lines */
/* Former Q:Lines */
function
ini_Restrict
(
arg
,
ini
)
{
function
ini_Restrict
(
arg
,
ini
)
{
var
masks
,
i
;
if
(
!
ini
.
Mask
)
{
if
(
!
ini
.
Mask
)
{
log
(
LOG_WARNING
,
format
(
log
(
LOG_WARNING
,
format
(
"
!WARNING Missing Mask from Restrict:%s. Section ignored.
"
,
"
!WARNING Missing Mask from Restrict:%s. Section ignored.
"
,
...
@@ -474,11 +507,16 @@ function ini_Restrict(arg, ini) {
...
@@ -474,11 +507,16 @@ function ini_Restrict(arg, ini) {
));
));
return
;
return
;
}
}
masks
=
ini
.
Mask
.
split
(
"
,
"
);
for
(
i
in
masks
)
{
QLines
.
push
(
new
QLine
(
QLines
.
push
(
new
QLine
(
ini
.
Mask
,
masks
[
i
]
,
ini
.
Reason
?
ini
.
Reason
:
"
No reason provided.
"
ini
.
Reason
?
ini
.
Reason
:
"
No reason provided.
"
));
));
}
}
}
function
ini_RBL
(
arg
,
ini
)
{
function
ini_RBL
(
arg
,
ini
)
{
if
(
!
ini
.
Hostname
)
{
if
(
!
ini
.
Hostname
)
{
...
...
This diff is collapsed.
Click to expand it.
exec/load/ircd/core.js
+
3
−
3
View file @
8e5bab52
...
@@ -1448,7 +1448,7 @@ function IRCClient_do_stats(statschar) {
...
@@ -1448,7 +1448,7 @@ function IRCClient_do_stats(statschar) {
case
"
c
"
:
case
"
c
"
:
for
(
i
in
CLines
)
{
for
(
i
in
CLines
)
{
this
.
numeric
(
213
,
format
(
this
.
numeric
(
213
,
format
(
"
C %s * %s %s %
s
"
,
"
C %s * %s %s %
u
"
,
CLines
[
i
].
host
,
CLines
[
i
].
host
,
CLines
[
i
].
servername
,
CLines
[
i
].
servername
,
CLines
[
i
].
port
?
CLines
[
i
].
port
:
"
*
"
,
CLines
[
i
].
port
?
CLines
[
i
].
port
:
"
*
"
,
...
@@ -1456,7 +1456,7 @@ function IRCClient_do_stats(statschar) {
...
@@ -1456,7 +1456,7 @@ function IRCClient_do_stats(statschar) {
));
));
if
(
NLines
[
i
])
{
if
(
NLines
[
i
])
{
this
.
numeric
(
214
,
format
(
this
.
numeric
(
214
,
format
(
"
N %s * %s %s %
s
"
,
"
N %s * %s %s %
u
"
,
NLines
[
i
].
host
,
NLines
[
i
].
host
,
NLines
[
i
].
servername
,
NLines
[
i
].
servername
,
NLines
[
i
].
flags
,
NLines
[
i
].
flags
,
...
@@ -1479,7 +1479,7 @@ function IRCClient_do_stats(statschar) {
...
@@ -1479,7 +1479,7 @@ function IRCClient_do_stats(statschar) {
case
"
i
"
:
case
"
i
"
:
for
(
i
in
ILines
)
{
for
(
i
in
ILines
)
{
this
.
numeric
(
215
,
format
(
this
.
numeric
(
215
,
format
(
"
I %s * %s %s %
s
"
,
"
I %s * %s %s %
u
"
,
ILines
[
i
].
ipmask
,
ILines
[
i
].
ipmask
,
ILines
[
i
].
hostmask
,
ILines
[
i
].
hostmask
,
ILines
[
i
].
port
?
ILines
[
i
].
port
:
"
*
"
,
ILines
[
i
].
port
?
ILines
[
i
].
port
:
"
*
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment