We cannot check if the db is connected in the library as that has no
full B_DB class structure. So we now check the connected state of
the database connection in the escape and insert handler which are
registered by the director.
Fix bug #1943 no message storage on closed database connection.
Bacula director crashes if it reaches the max number connections to
MySQL server. (Or any other database) as it tries to store the
failure to connect to the database in the database over a non
connected database connection. Things like mysql_real_escape_string
which is used in that code path depend on a connected database
connection which we don't have.
Fix bug #1946 Fix problem with MySQL with big Base jobs.
This patch adds an index on the temporary table "basefilesXXX",
where XXX is the JobId. This index reduce heavily the time for full
backups with big BaseJobs with bacula 5.2 and MySQL backend.
ACL and XATTR support for GNU/Hurd and autoconf support for
detecting GNU Hurd and setting the correct DISTNAME etc. and
proper platform support for GNU hurd.
As part of the support for getaddrinfo which replaces the obsolete
gethostbyname interface in POSIX we can now connect to IPv6 mailhosts.
As it seems on a lot of hosts localhost is defined first as IPv6
address and then as IPv4 address. As a result of this bsmtp tries
to connect to a local mailhost using the ipv6 protocol but most
people forget to allow relay rights for IPv6 local SMTP traffic
and as such the mail is dropped. So for now we revert the behaviour
of bsmtp to only connect to IPv4 mailhosts unless the -a option
is given which will query the name service for any suitable protocol.
With getaddrinfo we could get back theorethically
an protocol family that we don't support on the
local client. Now we set our hints better we are
probably safe but lets put in some extra safeguards.
inet_pton returns 1 when it succeeds so the test was wrong. When
it fails its either returns 0 if not a correct ipv6 address or
-1 when the protocol family is not known. Checked the man page
for both Linux and Solaris and this seems like an oversight as
the definition is the same on these OSes and probably on all others
as these functions tend to be rather portable.
Also did some small rewrite of the code so its easier to read and
the braces are easier to interpret.
We are only interested in SOCK_STREAM and protocol IPPROTO_TCP
as that is the way we communicate. When we don't specify that
in the hints for getaddrinfo we also get SOCK_DGRAM/IPPROTO_UDP
and on Linux SOCK_RAW. And possibly more on other platforms.
So lets me more specific. The older fix to suppress duplicates
is also useable as a user might specify two or more names
that resolve to the same address and we want to suppress duplicates
also.
Both the storage daemon and director should use the correct name
in the usage output. The file daemon already uses bacula-fd and
from now on bacula-sd and bacula-dir is used for the other daemons
in their usage output.
SQL syntax error in UPDATE Counters and INSERT INTO Counters using
"Counters.MinValue" and "Counters.MaxValue"
Create specific queries in sql_cmds.c for the two queries in the
code that select and update counter records in the database.
All default queries in the sql_cmds.c are static from now on as
we don't want to polute the namespace with data that is only used
within sql_cmds.c to initialize the backend specific sql tables.
Remove any duplicate addresses on a addr dlist.
For listening it makes no sense as we cannot listen
multiple times on the same address with different sockets.
And for outbound connecting its also kind of strange to
try to connect multiple times to the same address.