refact(core): simplify valid group name check
This commit is contained in:
@@ -362,12 +362,8 @@ impl Pacdef {
|
|||||||
// prevent group names that resolve to directories
|
// prevent group names that resolve to directories
|
||||||
for name in new_groups {
|
for name in new_groups {
|
||||||
ensure!(
|
ensure!(
|
||||||
*name != ".",
|
*name != "." && *name != "..",
|
||||||
crate::Error::InvalidGroupName(".".to_string())
|
crate::Error::InvalidGroupName(name.to_owned())
|
||||||
);
|
|
||||||
ensure!(
|
|
||||||
*name != "..",
|
|
||||||
crate::Error::InvalidGroupName("..".to_string())
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user