Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Only send catalog when an explicit catalog is set for a director.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco van Wieringen committed Aug 8, 2016
1 parent 820ee09 commit 27abc4d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
11 changes: 5 additions & 6 deletions config/autoload/global.php
Expand Up @@ -164,37 +164,36 @@ function read_directors_ini($directors, $directors_ini)
$arr[key($directors)]['ca_file'] = $instance['ca_file'];
}
else {
$arr[key($directors)]['ca_file'] = "";
$arr[key($directors)]['ca_file'] = null;
}

if(array_key_exists('cert_file', $instance) && isset($instance['cert_file'])) {
$arr[key($directors)]['cert_file'] = $instance['cert_file'];
}
else {
$arr[key($directors)]['cert_file'] = "";
$arr[key($directors)]['cert_file'] = null;
}

if(array_key_exists('cert_file_passphrase', $instance) && isset($instance['cert_file_passphrase'])) {
$arr[key($directors)]['cert_file_passphrase'] = $instance['cert_file_passphrase'];
}
else {
$arr[key($directors)]['cert_file_passphrase'] = "";
$arr[key($directors)]['cert_file_passphrase'] = null;
}

if(array_key_exists('allowed_cns', $instance) && isset($instance['allowed_cns'])) {
$arr[key($directors)]['allowed_cns'] = $instance['allowed_cns'];
}
else {
$arr[key($directors)]['allowed_cns'] = "";
$arr[key($directors)]['allowed_cns'] = null;
}

if(array_key_exists('catalog', $instance) && isset($instance['catalog'])) {
$arr[key($directors)]['catalog'] = $instance['catalog'];
}
else {
$arr[key($directors)]['catalog'] = "MyCatalog";
$arr[key($directors)]['catalog'] = null;
}

}

next($directors);
Expand Down
4 changes: 2 additions & 2 deletions install/directors.ini
Expand Up @@ -17,8 +17,8 @@ diraddress = "localhost"
; Default value is 9101
dirport = 9101

; Default value is "MyCatalog"
catalog = "MyCatalog"
; Set catalog to explicit value if you have multiple catalogs
;catalog = "MyCatalog"

; Note: TLS has not been tested and documented, yet.
;tls_verify_peer = false
Expand Down
6 changes: 4 additions & 2 deletions vendor/Bareos/library/Bareos/BSock/BareosBSock.php
Expand Up @@ -871,8 +871,10 @@ public function send_command($cmd, $api=0, $jobid=null)
break;
}

if(self::send("use catalog=" . $this->config['catalog'])) {
$debug = self::receive_message();
if (isset($this->config['catalog'])) {
if(self::send("use catalog=" . $this->config['catalog'])) {
$debug = self::receive_message();
}
}

if($jobid != null) {
Expand Down

0 comments on commit 27abc4d

Please sign in to comment.