Skip to content

Commit d72ee1a

Browse files
authored
Merge pull request #915 from sg2342/fix_awk_check_name_in_extended_bin
fix awk script check_name() in extended_bin
2 parents ed110ab + eecc738 commit d72ee1a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

priv/templates/extended_bin

+8-2
Original file line numberDiff line numberDiff line change
@@ -617,10 +617,16 @@ RELX_CONFIG_PATH=$(check_replace_os_vars sys.config "$RELX_CONFIG_PATH")
617617
# - missing -name or -sname parameters
618618
# If all checks pass, extract the target node name
619619
set +e
620-
TMP_NAME_ARG=$(awk 'function check_name(file)
620+
TMP_NAME_ARG=$(awk 'function shell_quote(str)
621+
{
622+
gsub(/'\''/,"'\'\\\\\'\''", str);
623+
return "'\''" str "'\''"
624+
}
625+
626+
function check_name(file)
621627
{
622628
# if file exists, then it should be readable
623-
if (system("test -f "file) == 0 && system("test -r "file) != 0) {
629+
if (system("test -f " shell_quote(file)) == 0 && system("test -r " shell_quote(file)) != 0) {
624630
print file" not readable"
625631
exit 3
626632
}

0 commit comments

Comments
 (0)