We initialize all tls stuff in the check_resources function except
for the tls stuff for storages which we initialize in the
check_catalog function because we walk the storages there already.
This might be an optimization but it doesn't make sense its better
to check the whole resources stuff in the check_resources function
as the name seems to imply that is what is done there.
Support the new POSIX getaddrinfo interface which replaces
the dated gethostbyname interface which is obsoleted in
the POSIX 1003.1 standard. When getaddrinfo is supported
by the OS its the prefered interface as gethostbyname is
not thread-safe and we don't support the gethostbyname_r
thread-safe version of gethostbyname.
The bnet code is changed to support the absolute mimimum set
of the getaddrinfo interface replacing only the core functions
normally performed by gethostbyname. We could add more generic
support for the getaddrinfo function but have not for now.
bstmp is changed to use the full getaddrinfo functionality
so it now can also connect to ipv6 mailhost when getaddrinfo
is used.
Also all sprintf calls in bsmtp are replaced with snprintf calls.
Fix mysql config for older versions of mysql+config.
On older versions of mysql_config the newly used
flags are not supported. So we test if the new flag
is supported and otherwise fallback to a kludge with
some sed strings to get the info we want from the
older mysql_config options.
Eric Bollengier [Thu, 12 Apr 2012 12:01:14 +0000 (14:01 +0200)]
Fix #4062 on make_catalog_backup.pl script when user/password are empty
The make_catalog_backup.pl sets PGUSER and PGPASSWORD env vars even if they
are not set in the bacula config. This leads to an error if postgresql is used
with IDENT authentification.
The following error message is printed:
---
pg_dump: [archiver (db)] connection to database "bacula" failed: FATAL: no
PostgreSQL user name specified in startup packet
Fix bug #1853: bacula-sd dead but pid file exists.
We scanned using a %d pattern into a bool value. On some
platforms (SPARC) this gives a severe SIGBUS e.g. bus error
as the sizeof(bool) on 64 bits is 1 byte and the %d uses an
integer value which is 4 bytes. Its obvious now we know this
problem that its an problem on other platforms too but it
seems only on SPARC it triggers a hardware error by the CPU.
The workaround is to use a temporary variable and set the
bool to either true or false based on the integer value.
Fix bug #1848 bsock.c:335 Socket has errors=1 on call to client
Removed the unneeded bnet_sig(dir, BNET_EOD) as the calling
function changer_cmd in dircmd.c already sets the BNET_EOD on
returning. So the autochanger_cmd function doesn't need to do
it.
The second Include {} block is using the Accurate=A option from the first Include{}. With this
fix, the Accurate/BaseJob/Verify options are set to default between two Include{}.
We still have the same kind of problem for the "flags" that contains most options.
Something like the following configuration won't work as expected:
FileSet {
Name = X
Include {
Options { Portable = no }
File = /tmp
}
Eric Bollengier [Fri, 10 Feb 2012 16:32:10 +0000 (17:32 +0100)]
Remove bad optimization from Accurate code
By returning "already seen", we didn't reply to the original question:
has the file changed (must be backed up)?
If your fileset contains two Include {} sections the second Include may ask for
the same files than the first Include, and depending on Exclude, Wild, etc..
the answer may be "Already Seen" even if the file needs to be saved. From what
I can see, Wild/Exclude are called after the accurate check.
The errno gets saved on an instantiate of the berrno class so
we should instantiate the class after the actual errno is set
and not as we used to do at the start of the function. Then
errno is always 0 and that also explains that on error it
was always printing Unknown error 0 in the error printed.
Moved all berrno into either an if block or an block within
a switch (including additional brackets so it a local code
block in which we can instantiate a new berrno class.
On Linux the actual rootfs gets mounted over an initial
rootfs. The mountcache on Linux is populated with the
content of /proc/mounts and as such it will contain 2
entries for the rootfs. So when the fstype function
is used to lookup the type of filesystem based on
the dev_t value it will always find the rootfs first.
But people expect to find either ext2, ext3 etc.
so we added a table with per OS (currently only Linux)
the filesystem which should NOT be loaded into the
internal lookup table.
The selection in MediaView::getSelection doesn't work ok as
the internal table is sized using the number of selected items
and not the number of rows in the total table. But the table
is indexed using a row number which can be any rownr of the
total of the table. Things seen is that 3 rows are selected
but the selection only returns 2. This is probably a side effect
because the code could also just have crashed as nb = 16 and
rownr = 29-31 e.g. addressed outside the bounds of the array.
Changed the internal array to use bools instead of ints so
its also somewhat smaller.