Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix awk script check_name() in extended_bin #915

Merged
merged 1 commit into from
May 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions priv/templates/extended_bin
Original file line number Diff line number Diff line change
Expand Up @@ -617,10 +617,16 @@ RELX_CONFIG_PATH=$(check_replace_os_vars sys.config "$RELX_CONFIG_PATH")
# - missing -name or -sname parameters
# If all checks pass, extract the target node name
set +e
TMP_NAME_ARG=$(awk 'function check_name(file)
TMP_NAME_ARG=$(awk 'function shell_quote(str)
{
gsub(/'\''/,"'\'\\\\\'\''", str);
return "'\''" str "'\''"
}

function check_name(file)
{
# if file exists, then it should be readable
if (system("test -f "file) == 0 && system("test -r "file) != 0) {
if (system("test -f " shell_quote(file)) == 0 && system("test -r " shell_quote(file)) != 0) {
print file" not readable"
exit 3
}
Expand Down