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

Properly handle an include file name ending with '\' #2441

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion keepalived/core/track_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ static int set_proc_ev_listen(int nl_sd, bool enable)

rc = send(nl_sd, &nlcn_msg, sizeof(nlcn_msg), 0);
if (rc == -1) {
log_message(LOG_INFO, "Failed to set/clear process event listen - errno %d - %m", errno);
log_message(LOG_INFO, "Failed to %s process event listen - errno %d - %m", enable ? "set" : "clear", errno);
return -1;
}

Expand Down
7 changes: 4 additions & 3 deletions lib/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1648,9 +1648,10 @@ have_brace(const char *conf_file)
return false;

do {
if (*p == '\\')
p++;
else if (*p == '{')
if (*p == '\\') { // Skip a '\' and following character
if (!*++p) // Ensure '\' not last character
return false;
} else if (*p == '{')
return true;
} while (*++p);

Expand Down
Loading