mirror of
https://github.com/jech/galene.git
synced 2024-11-22 08:35:57 +01:00
Don't allow group names to start with a period.
This commit is contained in:
parent
d440cdf898
commit
8c21ede9d2
3 changed files with 11 additions and 2 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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 ""
|
||||||
|
|
Loading…
Reference in a new issue