Skip to content

Commit

Permalink
Merge pull request #434 from bareos/dev/franku/bareos-19.2/messages-p…
Browse files Browse the repository at this point in the history
…athlength

dev/franku/bareos 19.2/messages pathlength
  • Loading branch information
franku committed Feb 27, 2020
2 parents 145c873 + 3639c9f commit 548c703
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion core/src/lib/parse_conf.h
Expand Up @@ -67,7 +67,7 @@ struct ResourceTable {
* Common Resource definitions
*/
#define MAX_RES_NAME_LENGTH \
MAX_NAME_LENGTH - 1 /* maximum resource name length */
(MAX_NAME_LENGTH - 1) /* maximum resource name length */

/*
* Config item flags.
Expand Down
17 changes: 8 additions & 9 deletions core/src/lib/res.cc
Expand Up @@ -368,27 +368,26 @@ void ConfigurationParser::StoreMsgs(LEX* lc,
Dmsg0(900, "done with dest codes\n");
break;
case MessageDestinationCode::kFile:
case MessageDestinationCode::kAppend:
dest = GetPoolMemory(PM_MESSAGE);

case MessageDestinationCode::kAppend: {
/*
* Pick up a single destination.
*/
token = LexGetToken(lc, BCT_NAME); /* Scan destination */
PmStrcpy(dest, lc->str);
token = LexGetToken(lc, BCT_STRING); /* Scan destination */
std::string dest_file_path(lc->str);
dest_len = lc->str_len;
token = LexGetToken(lc, BCT_SKIP_EOL);
Dmsg1(900, "StoreMsgs dest=%s:\n", NPRT(dest));
Dmsg1(900, "StoreMsgs dest=%s:\n", dest_file_path.c_str());
if (token != BCT_EQUALS) {
scan_err1(lc, _("expected an =, got: %s"), lc->str);
return;
}
ScanTypes(lc, message_resource,
static_cast<MessageDestinationCode>(item->code), dest,
std::string(), message_resource->timestamp_format_);
FreePoolMemory(dest);
static_cast<MessageDestinationCode>(item->code),
dest_file_path, std::string(),
message_resource->timestamp_format_);
Dmsg0(900, "done with dest codes\n");
break;
}
default:
scan_err1(lc, _("Unknown item code: %d\n"), item->code);
return;
Expand Down
Expand Up @@ -2,7 +2,7 @@ Messages {
Name = Standard
Description = "Message delivery for all reasonable directions"
Console = all
Append = "@logdir@/append" = all
Append = "@logdir@/append-to-a-very-long-file-12345678901234567890123456789012345678901234567890abcdefghijklmnopqrstuvwxyz12345678901234567890abcdefg" = all
Catalog = all
Syslog = all
Stdout = all
Expand Down
2 changes: 1 addition & 1 deletion systemtests/tests/messages-resource/testrunner
Expand Up @@ -21,7 +21,7 @@ syslog_file="${BAREOS_LOG_DIR}"/syslog
dblog_file="${BAREOS_LOG_DIR}"/dblog
stdout_file="${BAREOS_LOG_DIR}"/stdout
stderr_file="${BAREOS_LOG_DIR}"/stderr
extra_append_file="${BAREOS_LOG_DIR}"/append
extra_append_file="${BAREOS_LOG_DIR}"/append-to-a-very-long-file-12345678901234567890123456789012345678901234567890abcdefghijklmnopqrstuvwxyz12345678901234567890abcdefg
mail_file="${BAREOS_LOG_DIR}"/mail
operator_file="${BAREOS_LOG_DIR}"/operator

Expand Down

0 comments on commit 548c703

Please sign in to comment.