Skip to content

Commit

Permalink
Merge pull request #2441 from pqarmitage/updates
Browse files Browse the repository at this point in the history
Properly handle an include file name ending with '\'
  • Loading branch information
pqarmitage authored Jul 9, 2024
2 parents cf0f3e5 + 0b894f9 commit 1c4a7df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
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

0 comments on commit 1c4a7df

Please sign in to comment.