From: Kern Sibbald Date: Sun, 14 May 2017 10:02:45 +0000 (+0200) Subject: Add FD back compatibility X-Git-Tag: Release-7.9.0~31 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ab917172e819f81aeaecd18c85cc790e1efa6291;p=bacula%2Fbacula Add FD back compatibility --- diff --git a/bacula/src/dird/getmsg.c b/bacula/src/dird/getmsg.c index 07fd816e59..e05e63b584 100644 --- a/bacula/src/dird/getmsg.c +++ b/bacula/src/dird/getmsg.c @@ -199,7 +199,8 @@ int bget_dirmsg(BSOCK *bs) * a message to dispatch, or a catalog request. * Try to fulfill it. */ - if (sscanf(bs->msg, "%020s JobId=%ld ", MsgType, &JobId) != 2) { + if ((sscanf(bs->msg, "%020s JobId=%ld ", MsgType, &JobId) != 2) && + (sscanf(bs->msg, "%020s Job=x", MsgType) != 1)) { if (is_msgid(strchr(bs->msg, '['))) { return n; } @@ -207,7 +208,7 @@ int bget_dirmsg(BSOCK *bs) continue; } - /* Skip past "Jmsg JobId=nnn" */ + /* Skip past first two fields: "Jmsg JobId=nnn" */ if (!(msg=find_msg_start(bs->msg))) { Jmsg1(jcr, M_ERROR, 0, _("Malformed message: %s\n"), bs->msg); continue; @@ -276,13 +277,17 @@ int bget_dirmsg(BSOCK *bs) if (bs->msg[0] == 'P') { /* Progress report */ uint32_t files, bps; uint64_t bytes; - if (sscanf(bs->msg, "Progress Job=x files=%ld bytes=%lld bps=%ld\n", - &files, &bytes, &bps) == 3) { - Dmsg2(900, "JobId=%d %s", jcr->JobId, bs->msg); - /* Save progress data */ - jcr->JobFiles = files; - jcr->JobBytes = bytes; - jcr->LastRate = bps; + if ((sscanf(bs->msg, "Progress JobId=%ld files=%ld bytes=%lld bps=%ld\n", + &JobId, &files, &bytes, &bps) == 4) || + (sscanf(bs->msg, "Progress Job=x files=%ld bytes=%lld bps=%ld\n", + &files, &bytes, &bps) == 3)) { + Dmsg2(900, "JobId=%d %s", jcr->JobId, bs->msg); + /* Save progress data */ + jcr->JobFiles = files; + jcr->JobBytes = bytes; + jcr->LastRate = bps; + } else { + Jmsg1(jcr, M_ERROR, 0, _("Malformed message: %s\n"), bs->msg); } continue; }