From 51d5f3658c2cbcc70d4c9ac33d797626821189b3 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 18 Sep 2005 09:56:20 +0000 Subject: [PATCH] - Apply Landon's patch for the TLS ANS1 API change. - Remove old code. - Make single exit path in first_open_device(). git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2395 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/kernstodo | 4 ++++ bacula/kes-1.37 | 4 ++++ bacula/src/lib/tls.c | 41 +++++++++++++++++++------------------ bacula/src/stored/acquire.c | 10 --------- bacula/src/stored/device.c | 13 ++++++------ bacula/src/version.h | 4 ++-- 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/bacula/kernstodo b/bacula/kernstodo index f922f9a6df..c30214aefb 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -63,6 +63,10 @@ Document: - Does WildFile match against full name? Doc. For 1.39: +- "Minimum Job Interval = nnn" sets minimum interval between Jobs + of the same level and does not permit multiple simultaneous + running of that Job (i.e. lets any previous invocation finish + before doing Interval testing). - Look at simplifying File exclusions. - Fix store_yesno to be store_bitmask. - New directive "Delete purged Volumes" diff --git a/bacula/kes-1.37 b/bacula/kes-1.37 index 2099158693..72014d6f53 100644 --- a/bacula/kes-1.37 +++ b/bacula/kes-1.37 @@ -4,6 +4,10 @@ General: Changes to 1.37.39: +18Sep05 +- Apply Landon's patch for the TLS ANS1 API change. +- Remove old code. +- Make single exit path in first_open_device(). 17Sep05 - Make new_volume walk through all Vols looking for dev to release. diff --git a/bacula/src/lib/tls.c b/bacula/src/lib/tls.c index 024b8c3034..c660505f3c 100644 --- a/bacula/src/lib/tls.c +++ b/bacula/src/lib/tls.c @@ -21,23 +21,20 @@ * under an alternate open source license please contact * Landon Fuller . */ -/* - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* + Copyright (C) 2005 Kern Sibbald + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + version 2 as amended with additional clauses defined in the + file LICENSE in the main source directory. + + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, - MA 02111-1307, USA. - */ + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + the file LICENSE for additional details. + */ #include "bacula.h" #include @@ -331,32 +328,36 @@ bool tls_postconnect_verify_host(TLS_CONNECTION *tls, const char *host) X509V3_EXT_METHOD *method; STACK_OF(CONF_VALUE) *val; CONF_VALUE *nval; - unsigned char *data; void *extstr = NULL; +#if (OPENSSL_VERSION_NUMBER >= 0x0090800FL) + const unsigned char *ext_value_data; +#else + unsigned char *ext_value_data; +#endif /* Get x509 extension method structure */ if (!(method = X509V3_EXT_get(ext))) { break; } - data = ext->value->data; + ext_value_data = ext->value->data; #if (OPENSSL_VERSION_NUMBER > 0x00907000L) if (method->it) { /* New style ASN1 */ /* Decode ASN1 item in data */ - extstr = ASN1_item_d2i(NULL, &data, ext->value->length, + extstr = ASN1_item_d2i(NULL, &ext_value_data, ext->value->length, ASN1_ITEM_ptr(method->it)); } else { /* Old style ASN1 */ /* Decode ASN1 item in data */ - extstr = method->d2i(NULL, &data, ext->value->length); + extstr = method->d2i(NULL, &ext_value_data, ext->value->length); } #else - extstr = method->d2i(NULL, &data, ext->value->length); + extstr = method->d2i(NULL, &ext_value_data, ext->value->length); #endif /* Iterate through to find the dNSName field(s) */ diff --git a/bacula/src/stored/acquire.c b/bacula/src/stored/acquire.c index 4b88e35146..8c2d9e80cf 100644 --- a/bacula/src/stored/acquire.c +++ b/bacula/src/stored/acquire.c @@ -195,16 +195,6 @@ DCR *acquire_device_for_read(DCR *dcr) goto default_path; } -#ifdef xxx_needed - /* If we have a dvd that requires mount, - * we need to try to open the label, so the info can be reported - * if a wrong volume has been mounted. - */ - if (dev->is_dvd() && (dcr->VolCatInfo.VolCatParts > 0)) { - break; - } -#endif - Jmsg3(jcr, M_FATAL, 0, _("Open device %s Volume \"%s\" failed: ERR=%s\n"), dev->print_name(), dcr->VolumeName, strerror_dev(dev)); goto get_out; diff --git a/bacula/src/stored/device.c b/bacula/src/stored/device.c index 6a2f584ccc..0a3c945604 100644 --- a/bacula/src/stored/device.c +++ b/bacula/src/stored/device.c @@ -246,6 +246,7 @@ void set_new_file_parameters(DCR *dcr) bool first_open_device(DCR *dcr) { DEVICE *dev = dcr->dev; + bool ok = true; Dmsg0(120, "start open_output_device()\n"); if (!dev) { @@ -257,8 +258,7 @@ bool first_open_device(DCR *dcr) /* Defer opening files */ if (!dev->is_tape()) { Dmsg0(129, "Device is file, deferring open.\n"); - unlock_device(dev); - return true; + goto bail_out; } int mode; @@ -271,14 +271,15 @@ bool first_open_device(DCR *dcr) dev->open_nowait = true; if (dev->open(dcr, mode) < 0) { Emsg1(M_FATAL, 0, _("dev open failed: %s\n"), dev->errmsg); - dev->open_nowait = false; - unlock_device(dev); - return false; + ok = false; + goto bail_out; } Dmsg1(129, "open dev %s OK\n", dev->print_name()); + +bail_out: dev->open_nowait = false; unlock_device(dev); - return true; + return ok; } /* diff --git a/bacula/src/version.h b/bacula/src/version.h index d74c8b23f5..00b0fa468d 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "1.37.39" -#define BDATE "17 September 2005" -#define LSMDATE "17Sep05" +#define BDATE "18 September 2005" +#define LSMDATE "18Sep05" /* Debug flags */ #undef DEBUG -- 2.39.5