From c9d8a39355f2bf6b26ab2e6d182dd3ed5b19c62e Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 10 Jun 2017 16:24:51 +0200 Subject: [PATCH] Make getmsg.c compatible with old FDs --- bacula/src/dird/getmsg.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bacula/src/dird/getmsg.c b/bacula/src/dird/getmsg.c index 748a3d3bd5..7e5a73df33 100644 --- a/bacula/src/dird/getmsg.c +++ b/bacula/src/dird/getmsg.c @@ -138,6 +138,7 @@ static bool is_msgid(char *msg) int bget_dirmsg(BSOCK *bs) { int32_t n = BNET_TERMINATE; + char Job[MAX_NAME_LENGTH]; JobId_t JobId = 0; char MsgType[20]; int type; @@ -200,6 +201,7 @@ int bget_dirmsg(BSOCK *bs) * Try to fulfill it. */ if ((sscanf(bs->msg, "%020s JobId=%ld ", MsgType, &JobId) != 2) && + (sscanf(bs->msg, "%020s Job=%127s ", MsgType, Job) != 2) && (sscanf(bs->msg, "%020s Job=x", MsgType) != 1)) { if (is_msgid(strchr(bs->msg, '['))) { return n; @@ -221,8 +223,10 @@ int bget_dirmsg(BSOCK *bs) * the protocol. */ if (bs->msg[0] == 'J') { /* Job message */ - if (sscanf(bs->msg, "Jmsg JobId=%ld type=%d level=%lld", - &JobId, &type, &mtime) != 3) { + if ((sscanf(bs->msg, "Jmsg JobId=%ld type=%d level=%lld", + &JobId, &type, &mtime) != 3) && + (sscanf(bs->msg, "Jmsg Job=%127s type=%d level=%lld", + Job, &type, &mtime) != 3)) { Jmsg1(jcr, M_ERROR, 0, _("Malformed message: %s\n"), bs->msg); continue; } -- 2.39.5