iucvterm/ts-shell: Improve regex for matching terminal identifier

Anchor the regex to no longer match a part within the terminal
identifier.

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Hendrik Brueckner
2026-07-06 13:48:24 +02:00
committed by Jan Höppner
parent 419d93bef7
commit e6de495daa

View File

@@ -430,7 +430,7 @@ sub cmd_connect($\%)
}
my ($guest, $srv) = split /\s+/, $params;
$service = $srv if $srv && $srv =~ /\w{1,8}/;
$service = $srv if $srv && $srv =~ /^\w{1,8}$/;
# check authorization:
# The auth_func contract is to return a code, that must be one of:
@@ -496,7 +496,7 @@ sub cmd_service($\%)
return;
}
if ($new =~ /\w{1,8}/) {
if ($new =~ /^\w{1,8}$/) {
$cfg->{service} = $new;
# push new service for cmd completion
unless (grep /$new/, @{$cfg->{services}}) {