Fix compiler warnings.
Retry autochanger query for slots

In essence this is a bug in the firmware but it seems there are quite
some libraries which seem to be affected. We now retry the query one
more time when we get a zero slots returned.

Fixes #174: "status slots" says "0 slots" the first time after tapes
            were removed. Rerunning "status slots" then is correct.
Tweak retry logic a bit.
Fix crash when an unsupported cipher is configured.
Only check runscript dir when we are really executing the script.
sd: Avoid segfault in is_vol_in_autochanger().

If the sd config file contains a Device section for a device not
listed in the Autochanger config section, is_vol_in_autochanger()
might be called with vol->dev->device->changer_res being NULL.
However, the function dereferences this pointer unconditionally,
which results in a segfault.

This patch adds the necessary check and returns false in this case,
avoiding the crash.

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
Added some quotes

- Added quotes to make_catalog_backup.pl script
  (Thanks to Günter Gratzer)
- Added quotes in message when Allowed Job Command blocks.

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
Fixed single-drive mount problem
Revert "Fixed single-drive mount problem"

This reverts commit 85a888f0ac48f68ef62cd46686d2c895b1593e0e.
Fixed single-drive mount problem
Fix windows bpipe plugin.
Add config option for storing a diagnostic device.

For some setups with an autochanger you might want to query the
individual drives for tape alerts. As you cannot open the tape
device twice you need to access the drive via a SCSI generic
device. We now have a per device diagnostic device config variable
which you can expand using a %D in the tape alert cmdline. Normally
you should query the autochanger for tape alerts and that should also
report any tape drive errors but some devices implement this poorly and
as such it doesn't work. This option allows you to work around that and
actually ask the drive for any tape alerts.

Fixes #200: Storage Daemon Tape Alert Useless / Defective
Fix debugging output and print the right info.

We are printing the stuff we send to the SD not what we got back.
Conditionally enable VSS.

It only makes sense to adhere to the director requesting for VSS when we
have any File = statements in any Include block. So we now count the
number of File = statements in all Include blocks of the fileset and if
none are given (Plugins only for example) we ignore the request for VSS.
Refactor windows version detection code.

Added Windows 8 and Windows Server 2012 and use a switch on major and
minor number instead of a set of ifs.
Trace file to c:/ if working_directory is empty

When the working directory is empty, we now write the
trace file to c:/ instead of ./

When running as service, the workingdirectory seems to empty ,so
that the trace file is written to C:/windows/system32

This has different implications and makes it difficult to watch the
trace file.

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
Drop syslog.target from systemd service definitions.

Newer systemd versions implement a internal binary journalling system
which replaces syslog so the syslog.target is no longer available in
newer versions of systemd. So we dropped the dependency on it and hope
that our other dependencies make sure the syslogging is available.

Fixes #203: systemctl start bareos-fd.service fails on Fedora 19