]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Fix name parameter in jobs objects endpoint
authorMarcin Haba <marcin.haba@bacula.pl>
Tue, 24 Oct 2023 14:33:42 +0000 (16:33 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Thu, 2 Nov 2023 07:34:19 +0000 (08:34 +0100)
gui/baculum/protected/API/Pages/API/JobsObjects.php
gui/baculum/protected/API/openapi_baculum.json

index de42ad52e9433ef83be81960fa12d186a729c6d4..a509fd3d245a5b7db09346b4b61548a7a5fd3da7 100644 (file)
@@ -409,8 +409,14 @@ class JobsObjects extends BaculumAPIServer {
                );
                if ($result->exitcode === 0) {
                        $vals = [];
-                       if (!empty($jobname) && in_array($jobname, $result->output)) {
-                               $vals = [$jobname];
+                       if (!empty($jobname)) {
+                               if (in_array($jobname, $result->output)) {
+                                       $vals = [$jobname];
+                               } else {
+                                       $this->output = JobError::MSG_ERROR_JOB_DOES_NOT_EXISTS;
+                                       $this->error = JobError::ERROR_JOB_DOES_NOT_EXISTS;
+                                       return;
+                               }
                        } else {
                                $vals = $result->output;
                        }
index 31e636731673a6e52c9f28f9e00207613b8a384a..9cf84a0980be459057013a46ce32320ac024d865 100644 (file)
                                                                                "error": {
                                                                                        "type": "integer",
                                                                                        "description": "Error code",
-                                                                                       "enum": [0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 1000]
+                                                                                       "enum": [0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 50, 1000]
                                                                                }
                                                                        }
                                                                }