Allow updates from Bacula 2.x to Bareos.

Now that we have a smart database update script we can add the other
database conversion scripts and allow a user to update his database
also from an older Bacula version. (2.0 is what we cut off with the
client so also for the server it makes sense to not support
anything older.)
Fix leaked dl_handle.
Fix some missing break statements.
Fix typos.
Protect all access to dcr->job_spool_size via dcr->dev->spool_mutex
Only free a vollist when we have one.
Fix leaked file descriptor on error path.
Fix check of array value.
SD to SD replication makes SD crash

Problem is that we wait up to 30 minutes for the SD-SD replication
job to start but it could be that the total migration/copy run takes
longer then 30 minutes to finish all jobs. The current code doesn't take
this into consideration and doesn't check if there is actually a remote
SD that connected for doing the replication.

So fix is to not continue when sd replication socket is not connected.
And also remove the timeout on starting a SD-SD replication session.
The normal FD-SD connection is protected with a timeout so we don't hang
when a FD never connects. As we support canceling a storage Job from the
director and the director should cleanly cancel the storage job any way
when it fails the copy or migration job it should be no problem.

In a normal backup/restore there are 3 daemons involved e.g. director,
storage daemon and file daemon but with migration the director controls
everything and controls the at maximum two storage daemons.

Fixes #276: SD to SD replication makes SD crash
fixes path in univention-bareos-schema package

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
Autodetermine WIN_DEBUG and WIN_VERSION values

We now automatically determine the WIN_DEBUG value
from the version info, so if the version contains debug,
we set it to yes otherwise to no.

For the WIN_VERSION, we check if the name contains "64",
if so the WIN_VERSION is 64 else it is 32.
Last part in windows support, director on windows.

This patch adds the things needed to cross-compile the director using
MINGW on Linux. It adds the build infrastructure for building the
database backend infrastructure (catalog) and the actual director and
dbcheck for windows. It also adds the bsmtp binary in tools and the
changes needed to the installer to install all new stuff.

It does however not supply the database (postgresql or sqlite3) you
need to install those before running the bareos-installer.

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
Use proper filename for windows paths.

For ASCII paths you need to use unix_name_to_win32() and for UTF8 paths
make_win32_path_UTF8_2_wchar()

We were always doing first a unix_name_to_win32() and that output as
input for UTF8 make_win32_path_UTF8_2_wchar() that ain't going to work.

Fixes #274: bareos-fd on windows 7 struggles with unix-style pathes
added Coverity Scan to travis

see https://scan.coverity.com/

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
Fix some compiler warnings.
Fix some more compiler warnings.
Fix resource leak in create_pid_file().
Fix buffer overrun.
Fix resource leak.
Explicitly return NULL or 0 on M_ABORT error.

This makes the work for static analyzing tools a lot easier that
don't understand that a M_ABORT means stop executing the program
and abort creating a crash on our way out.