From 4bfd8ec4edc39813047b5366f8c08317e015ff1e Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 26 Jan 2010 15:36:18 +0100 Subject: [PATCH] Fix #1467 about ActionOnPurge with Devices having space --- bacula/src/dird/ua_purge.c | 3 +++ bacula/src/stored/dircmd.c | 1 + 2 files changed, 4 insertions(+) diff --git a/bacula/src/dird/ua_purge.c b/bacula/src/dird/ua_purge.c index c75411812b..dc101f1500 100644 --- a/bacula/src/dird/ua_purge.c +++ b/bacula/src/dird/ua_purge.c @@ -577,6 +577,7 @@ static BSOCK *open_sd_bsock(UAContext *ua) */ bool mark_media_purged(UAContext *ua, MEDIA_DBR *mr) { + char dev_name[MAX_NAME_LENGTH]; JCR *jcr = ua->jcr; if (strcmp(mr->VolStatus, "Append") == 0 || strcmp(mr->VolStatus, "Full") == 0 || @@ -593,6 +594,8 @@ bool mark_media_purged(UAContext *ua, MEDIA_DBR *mr) */ BSOCK *sd; if ((sd=open_sd_bsock(ua)) != NULL) { + bstrncpy(dev_name, ua->jcr->wstore->dev_name(), sizeof(dev_name)); + bash_spaces(dev_name); bash_spaces(mr->VolumeName); sd->fsend("action_on_purge %s vol=%s action=%d", ua->jcr->wstore->dev_name(), diff --git a/bacula/src/stored/dircmd.c b/bacula/src/stored/dircmd.c index 12b629560b..400647da13 100644 --- a/bacula/src/stored/dircmd.c +++ b/bacula/src/stored/dircmd.c @@ -896,6 +896,7 @@ static bool action_on_purge_cmd(JCR *jcr) goto done; } unbash_spaces(volumename.c_str()); + unbash_spaces(devname.c_str()); /* FIXME: autochanger, drive = 0? how can we avoid that? we only work on * files -- 2.39.5