automatically open the windows firewall

During installation, we now open the firewallport 9102 for bareos-fd.exe
per default. This can be disabled during installation.

During uninstall, this firewallrule is removed again.

Fixes #79: configure Windows firewall with package installation

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
travis build status

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
text format

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
Add copies to the allowed keyword for restore.

Its seems that you can use a set of copy jobs to do a restore when you
specify the copies keyword on the restore commandline.

e.g. restore copies will select instead of the normal
full/differential/incremental jobs the copies of those Jobs. When doing
offsite SD-SD replication this can be a good selection criteria when you
lost your primay storage daemon but can restore from the secondary
or standby storage daemon. As long as you have a working database this
is a good DR procedure. You still need a working director and database
but as the database can be replicated as an HA solution and a director
also have a cold standby this could be part of a solution.

Fixes #36: Implementation of restore using a set of copies of an original job
Upgraded jobs use wrong pool

With the introduction of a fix for "#1679 Job Overrides are Not listed
In Manual Run Confirmation" we introduced a bug in an interactive run
as we do an pool override early and ignore any changes later on by
setting a suppress boolean value. This doesn't work when a job gets
upgraded later on to lets say Full because no earlier Full was found
but it started out as an incremental Job.

Moved get_level_since_time() from fd_cmds.c to job.c where it
makes much more sense. Fixed comments and let it return a boolean
which is true when it updated the pool due to a missing
full/differential etc. Now when get_level_since_time() returns true
we force apply_pool_overrides() to ignore any overrides and always
reevaluate the pool it needs to save too (fullpool/diffpool/incpool)

Also moved the call to get_level_since_time() and apply_pool_overrides()
into setup_job() so we don't have to code it twice in
do_native_backup_init() and do_ndmp_backup_init().

get_level_since_time() now always encodes the since value into the
jcr->since variable so we only need one argument to the function
being the jcr and no longer a char pointer and size which for most
calls were pointing to something in the jcr anyway.

Fixes #88: Upgraded jobs use wrong pool
Allow for relaxed TLS configuration.

Current the verify_peer flag is hardcoded to true for the console
programs. It would be nice if we would allow a somewhat relaxed
TLS mode that allows to establish a TLS connection without the
need for very strict certificate checking which is done now. The
default setting is the same as before but the administrator can
relax this setting by setting the "TLS Verify Peer" option to
false in a definition of the client connection.

This doesn't have severe security implications as the authorization
with challenge response (md5 hashes) is done before the TLS handshake.
So this means you can have the same security as a non TLS connection
but with a relaxed config which means you get a encrypted datastream
even when you haven't put the whole certificate enrollment in place
e.g. CA certificate and potentially client certificates. Protocols
like LDAPS and ESMTP also allow this.

This is also the first version of the GNUTLS code that allows an
TLS encrypted session with the GNUTLS library as a replacement for
the openssl code. This currently is only tested with the relaxed
TLS configuration options set e.g. TLS Verify Peer = no

Fixes #122: Allow for relaxed TLS configuration.
Rebuild configure.
add daemon user to required groups

bareos storage daemon user must be in groups tape and/or disk
to be able to access tape devices.
Due to different behavior of different distributions
(install order if not always the same),
every package that requires a specific group/user set this up on its own.

preinstall:
  bareos-common: setup default daemon group bareos and user bareos
  bareos-filedaemon: setup fd group (bareos) and user (root)
  bareos-storage: setup sd group (bareos) and user (bareos)
  bareos-director: setup dir group (bareos) and user (bareos)

postinstall:
  bareos-storage:
    call bareos-config setup_sd_user, which
    checks if sd group and user exists, otherwise it creates them,
    and add the sd user (bareos) to the groups tape and disk, if they exists.

Tested on: Debian 6, Ubuntu 12.04 (32bit), SLES11SP2, Centos5

Fixes #99: user bareos unable to operate tape changer due to wrong permissions

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
travis: update to preinst script modified by configure

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
Rebuild configure.
more deterministic
initscripts: use debian 6.0 skeleton

recreate Debian and Ubuntu init scripts based on Debian/Ubuntu skeleton file.
Advantages:
- use standard skeleton
- "status" is now implemented and working, see bug #50
- start order: if a database is installed, it is started before the bareos-director
- Debian and Ubuntu are using the same init scripts
- bareos-dir, bareos-sd and bareos-fd are based on the same skeleton and differ only at the variables values
Changed:
- Debian standard skeleton utilise the VERBOSE variable.
  By default, VERBOSE equals "no" and init script are completly quiet.
  We follow this standard, even so we don't like it.
  This behavior can be changed by setting "VERBOSE=yes" in /etc/defaults/rcS