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
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
Implement plugin options passing.

Implement a new feature to pass plugin option as part of the restore process.
Most of the plugin options input was already implemented but for the restore
the options were never pushed to the file daemon. We should pass it to the
filed and raise a bEventPluginCommand event. This way a user can pass in extra
hints to the plugin for the restore process. Currently the plugin only gets
passed in the plugin options that were defined at the moment the backup was made.

The options defined by the user at restore time are passed before the actual
options saved at backup time are passed so the plugin should take care to ignore
any of the options passed in as part of the backup stream being restored
when it already got a override at restore time.

We increased the FD protocol number to 52 to be able to detect if the file daemon
understand the new protocol keyword.

Along the way we tweaked the layout of fileset traversal code somewhat. Added
some spaces and fixed the scoping of the variables somewhat. So you understand
what is going on. And fixed the comments in the filed plugin code.

Fixes #207: Implement plugin options passing.