From: norbert.bizet Date: Fri, 15 Dec 2023 10:02:58 +0000 (-0500) Subject: cloud storage: Fix #10291 Assume that driver ls can return error 1 when the path... X-Git-Tag: Beta-15.0.1~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c73468fd1c33aae6f2467b34f5f91976be450d5e;p=thirdparty%2Fbacula.git cloud storage: Fix #10291 Assume that driver ls can return error 1 when the path doesnt exist. Handle it in generic driver --- diff --git a/bacula/src/stored/generic_driver.c b/bacula/src/stored/generic_driver.c index 6cae0bc95..877dc02d8 100644 --- a/bacula/src/stored/generic_driver.c +++ b/bacula/src/stored/generic_driver.c @@ -1228,6 +1228,16 @@ bool generic_driver::get_cloud_volume_parts_list(const char* volume_name, ilist pcb.arg = (void*)&arg; int ret = call_fct("ls", volume_name, "part.", &pcb, NULL, cancel_cb, err); free_pool_memory(*arg.remain); + /* 1 is the generic return code for path not found, except for was driver that always return 0 */ + if (ret == 1) { + err = strip_trailing_junk(err); + pm_strcat(err, " Cloud volume "); + pm_strcat(err, volume_name); + pm_strcat(err, " not found.\n"); + /* the volume could not be found in the cloud: it's possible to list a Volume on cloud that doesn't exist. + Accept it as an OK behavior */ + return true; + } return (ret == 0); }