]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix #1467 about ActionOnPurge with Devices having space
authorEric Bollengier <eric@eb.homelinux.org>
Tue, 26 Jan 2010 14:36:18 +0000 (15:36 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 2 Aug 2010 14:49:23 +0000 (16:49 +0200)
bacula/src/dird/ua_purge.c
bacula/src/stored/dircmd.c

index c75411812bcd8943ccaeb7339fa816ca520143ef..dc101f15002f953d8e51763a65b6d45415f55e55 100644 (file)
@@ -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(),
index 12b629560bf2def428480e71f69e6f996fb0af72..400647da13eeffa314b86e41f46edccdad314a0c 100644 (file)
@@ -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