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
7f93a496
Commit
7f93a496
authored
Jan 17, 2025
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forbid backslashes in group names.
We used to only forbid them under Windows.
parent
41076461
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
group/group.go
group/group.go
+6
-2
group/group_test.go
group/group_test.go
+1
-0
No files found.
group/group.go
View file @
7f93a496
...
...
@@ -420,10 +420,14 @@ func Add(name string, desc *Description) (*Group, error) {
}
func
validGroupName
(
name
string
)
bool
{
if
filepath
.
Separator
!=
'/'
&&
strings
.
ContainsRune
(
name
,
filepath
.
Separator
)
{
if
strings
.
ContainsRune
(
name
,
'\\'
)
{
return
false
}
if
s
:=
filepath
.
Separator
;
s
!=
'/'
&&
s
!=
'\\'
{
if
strings
.
ContainsRune
(
name
,
s
)
{
return
false
}
}
s
:=
path
.
Clean
(
"/"
+
name
)
if
s
==
"/"
{
...
...
group/group_test.go
View file @
7f93a496
...
...
@@ -338,6 +338,7 @@ func TestValidGroupName(t *testing.T) {
{
"foo/.."
,
false
},
{
"foo/./bar"
,
false
},
{
"foo/../bar"
,
false
},
{
"foo
\\
bar"
,
false
},
{
"foo"
,
true
},
{
"foo/bar"
,
true
},
}
...
...
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