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.
Only try to close an database transaction when the database
is opened. Only destroy an rwl_lock when it is initialized.
As dbcheck only calls db_init_database and then db_close_database
the database is never opened and we try to end an transaction
on a non-opened database, the rwl_destroy will also give
an error (which is ignored) as the rwl_lock is only initialized
on opening of the database.
Add support for saving and restoring AFS acls using the
pioctl interface of (Open)AFS. This is mostly a proof of
concept its no where ready for production and may put
a enormous load on your AFS cell so please use it only
for testing. It also only solves part of the AFS backup
problem as we only save and restore acls on directories
on an AFS filesystem but not the actual cell configuration
etc. For that we advice you to use the native tooling
using some script or the bpipe plugin.
Delay allocation to last minute when we are mostly sure we can
save a real xattr and we only need to get the actual value of it.
This way we don't have to free data on strange code paths. Also
made most functions have one exit point so things are more clean.
As it seems we could speedup the insert of the batch mode
somewhat by using multi-row insert statements. This implements
a very simple routine which batch up 32 inserts into one
query before pushing it to the database. The 32 is arbitrary
and just a test value for now we can always bump or lower it.
Fix bug #1874 crash with xattr support on a BTRFS filesystem
Add some extra safeguards that structure are always initialized
the way we think they should be and a special code path doesn't
give freeing failures on non allocated memory.
On lookup of a hostname we could get back both IPv4 and IPV6 addresses
for a given host. But we may only support IPV4 on the local host
and as such trying to create an IPV6 socket will fail. If we check
the return code of the socket call for EAFNOSUPPORT we catch such
an error and can continue trying to create a socket type that is
supported.
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.