enforce strict service name rules
Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
parent
bf85069b32
commit
da1ffe1a7b
5
ssm
5
ssm
|
@ -767,6 +767,11 @@ flag_edit_service && { edit; die $?; }
|
||||||
service_name = "${1##*/}"
|
service_name = "${1##*/}"
|
||||||
readonly service_name
|
readonly service_name
|
||||||
|
|
||||||
|
# Enforce service_name to conform to BASH's name constraints
|
||||||
|
[[ $service_name =~ ^[a-zA-Z_][a-zA-Z0-9_]+?$ ]] || {
|
||||||
|
die 77 "Invalid service name: '$service_name'"
|
||||||
|
}
|
||||||
|
|
||||||
# These depend on the service_name and make little sense to reconfigure.
|
# These depend on the service_name and make little sense to reconfigure.
|
||||||
service_ready_flag := "$rundir/$service_name.ready"
|
service_ready_flag := "$rundir/$service_name.ready"
|
||||||
service_enabled_flag := "$rundir/$service_name.enabled"
|
service_enabled_flag := "$rundir/$service_name.enabled"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user