Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
galene
Commits
8c21ede9
Commit
8c21ede9
authored
Oct 28, 2021
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't allow group names to start with a period.
parent
d440cdf8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
README.PROTOCOL
README.PROTOCOL
+2
-2
group/group.go
group/group.go
+5
-0
webserver/webserver.go
webserver/webserver.go
+4
-0
No files found.
README.PROTOCOL
View file @
8c21ede9
...
@@ -24,8 +24,8 @@ message types.
...
@@ -24,8 +24,8 @@ message types.
### Group
### Group
A group is a set of clients. It is identified by a human-readable name
A group is a set of clients. It is identified by a human-readable name
that must not start or end with a slash "`/`"
and must not have the
that must not start or end with a slash "`/`"
, must not start with
substrings "`/../`" or "`/./`".
a period "`.`", and must not contain the
substrings "`/../`" or "`/./`".
### Client
### Client
...
...
group/group.go
View file @
8c21ede9
...
@@ -1085,6 +1085,11 @@ func Update() {
...
@@ -1085,6 +1085,11 @@ func Update() {
)
)
return
nil
return
nil
}
}
base
:=
filepath
.
Base
(
filename
)
if
base
[
0
]
==
'.'
{
log
.
Printf
(
"Group file %v ignored"
,
filename
)
return
nil
}
name
:=
filename
[
:
len
(
filename
)
-
5
]
name
:=
filename
[
:
len
(
filename
)
-
5
]
desc
,
err
:=
GetDescription
(
name
)
desc
,
err
:=
GetDescription
(
name
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
webserver/webserver.go
View file @
8c21ede9
...
@@ -262,6 +262,10 @@ func parseGroupName(prefix string, p string) string {
...
@@ -262,6 +262,10 @@ func parseGroupName(prefix string, p string) string {
return
""
return
""
}
}
if
name
[
0
]
==
'.'
{
return
""
}
if
filepath
.
Separator
!=
'/'
&&
if
filepath
.
Separator
!=
'/'
&&
strings
.
ContainsRune
(
name
,
filepath
.
Separator
)
{
strings
.
ContainsRune
(
name
,
filepath
.
Separator
)
{
return
""
return
""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment