ftp: Fix regression in gPlazma and billing cell names

Addresses a regression introduced in the recent change that remove
hard coded cell names. The batch file of the ftp services contained
a white space character different from an ASCII 32 space and thus
ended up being part of the cell name.

Target: trunk
Require-notes: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/5504/
ftp: Fix NPE regression in door initialization

Addresses a regression introduced in the recent removal of hard
coded cell names. The regression leads to a null pointer exception
during door initialization.

Target: trunk
Require-notes: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/5503/
SRM: log client disconnecting at debug level

Currently, if a client disconnects during the SSL/GSI handshake then
the EOFException is logged as just EOFException.  This is both
non-obvious and unnecessary as dCache is behaving correctly.

This patch updates the message to be meaningful and reduces the
log-level to debug.
SRM: don't talk to SpaceManager when disabled

There is a configuration value describing whether or not space-manager
is enabled.  Currently, SRM sends messages to space-manager even when
space-manager is disabled.  Because of this, sites are required to run
space-manager, even when it is disabled.

This patch alters the SRM so that if space-manager is disabled then not
communication with space-manager is attempted.  Under this circumstance,
SRM will report any space-token information for srmLs operations and
space-specific operations will fail with a friendly error message.
cleaner: Fix null pointer exception in 'hsms attached to pool' command

Addresses a null pointer exception in the cleaner.

Ticket: http://rt.dcache.org/Ticket/Display.html?id=7769
Target: trunk
Request: 2.6
Request: 2.2
Require-notes: yes
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/5493/
gplazma2-jaas: add principal mutator plugin

JAAS plug in can be configured to use any jaas login module. As a
result we may get principas which can't be handles by gplazma. New
MutatorPlugin allows to convert some principals to supported equivalents.

in gplazma.conf:
auth jaas
...
map optional mutator gplazma.mutator.accept=org.apache.activemq.jaas.UserPrincipal gplazma.mutator.produce=username
map sufficient nsswitch
...

The supported output types:
   dn
   name
   username
   kerberos
   fqan

Ticket: #7763
Acked-by: Paul Millar
Target: trunk, 2.6, 2.2
Require-book: yes
Require-notes: yes
Remove deprecated code.

Breaks compatibility with components older than dCache 2.6.

Target: trunk
Require-notes: no
Require-book: no
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: http://rb.dcache.org/r/5531/
system-test: downgrade missing trust from an error to a warning

Currently, the system-test module checks whether the environment is
properly configured to run secure clients against the system-test.
If this test fails then the system-test build fails.

There are (at least) a couple of reasons why failing the build is
wrong:

  1.  there are situations where building the system-test should not
      dependend on being able to successfully test dCache via
      system-test (e.g., "mvn release")

  2.  the user may use a client that is configured to use the
      trust-store provided within system-test.  Therefore, missing
      trust in the default locations isn't always a problem.

This patch downgrades the test failing from an error to a warning.  The
patch also rewords the message to try to avoid some confusion
experienced by users.

Patch: https://rb.dcache.org/r/5533/
Acked-by; Tigran Mkrtchyan
Target: master
Fix NPE when a class providing a SOAP service returns nothing
gsidcap: fix regression introduced by 969903b5

The patch entitled "a step towards configurable cell names for gPlazma
and billing", committed master@969903b5 added support in various doors
for configuring the gPlazma and billing cell names.

Unfortunately, the part touching the gsidcap door was broken as the
resulting code attempts to create the LoginStrategy before the gPlazma
CellStub is defined.  This results in an NPE any time a client attempts
to connect to dCache.

This patch fixes that issue by creating the LoginStrategy after the
required gPlazma CellStub is defined.

Patch: http://rb.dcache.org/r/5537/
Acked-by: Gerd Behrmann
Target: master
Update patch based on Gerd's comments
system-test: add ability to autogenerate host credentials

The system-test module creates a self-contained dCache instance.  It
does, however, require a host certificate, which currently is stored
in git.  The certificate was signed by a throw-away CA.

The host certificate stored in git makes use of the Globus
non-standard "host-certificate" extension ("CN=host/<name>").  This,
together with the lack of any subjectAltName extension means that only
Globus software will accept the host certificate.

Also, since the process for generating the certificate wasn't
documented, when the certificate runs out, generating a new
certificate may take some effort to create.

This patch adds support in the populate script for generating a
suitable host-certificate using OpenSSL.  The script
hostCredentials can generate a CA credentials, generates the host
credentials and installs the CA certificate, CA signing_policy and
host credentials, throwing away the CA private key.

By default, the host certificate has various DNS subjectAltName,
but if the --only-localhost option is specified then only
DNS:localhost is uesd.

The --install option will install the generated CA files in
~/.globus/certificates, so trusting the throwaway CA.

Target: master
Patch: https://rb.dcache.org/r/5529/
Acked-by: Gerd Behrmann

This patch adds support for generating the required host-certificate
using OpenSSL.  The process is triggered by running an extra script.
The script may also be used to install the trusted CA.
axis: fix NPE when the class providing a SOAP service has void method

The LoggingRPCProvider wraps the standard Axis method-based dispatch
and adds better logging of what's happening.

If the method being invoked (corresponding to some SOAP method) is
declared void or the method returns a null value then the
LoggingRPCProvider suffers an NPE.

This patch fixes this problem.  It also distinguishes between a void
method and a method returning null.

Note #1. None of the SRM operations trigger this problem as all such
methods return something (a class following a *Response naming scheme)

Note #2. Axis allows a method to have multiple OUT values by passing
value-handle objects as arguments to methods.  A future version of
LoggingRPCProvider should detect such methods and log such multi-OUT
values.

Target: master
Request: 2.6
Patch: http://rb.dcache.org/r/5538/
Acked-by: Gerd Behrmann
SRM: log client disconnecting at debug level

It is possible for the client to "give up" on a connection during the
SSL/GSI handshake exchange.  For example, this can happen if the
client doesn't trust the server's certificate.

When this happens, an EOFException is logged; for example:

30 Apr 2013 19:31:59 (SRM-zitpcx6184) [] java.io.EOFException

This message is both unintelligible and unnecessary, as dCache is
behaving correctly under the circumstances.

This patch updates the message to be meaningful, including the
client's IP address and port number in the diagnostic context. It also
reduces the log-level to debug.

Target: master
Request: 2.6
Patch: http://rb.dcache.org/r/5534/
Acked-by: Gerd Behrmann
Switch values of sanatised variable to 'true' or 'false'
SRM: don't talk to SpaceManager when disabled

A recent patch (committed master@2ba5c9 and 2.2@d069ff) fixed an NPE.
The submitter mentioned concerns that this would "break something",
which turned out to be correct.  After the patch, SRM verbose ls
(and space-related operations) no longer function correctly if
space-manager is disabled.  This is because SRM verbose-ls always
sends a request to space-manager and, after the patch, space-manager
gives an error-response when running but configured to be disabled.

This patch alters the SRM so that if configuration shows that
space-manager is disabled then no communication with space-manager
is attempted.  SRM verbose ls will list all files are in no
space-reservations and the space-related operations will fail with
a friendly error message.

A side-effect of this patch is that the 'spacemanager' service is
no longer needed when space-manager is disabled.

Target: master
Request: 2.6
Request: 2.2
Patch: http://rb.dcache.org/r/5526/
Acked-by: Gerd Behrmann
gplazma2-xacml: fix regression on network address sort

module:  gplazma2-xacml

svn trunk@18137 altered NetworkUtils to use an immutable list for local addresses.  The XACML plugin needs to sort these according to external/internal.  This sort was failing and causing failure to load the plugin (undiscovered until now).

Patch copies the immutable list and then sorts.

Redeployed and authenticated using XACML.

Target: master
Patch: http://rb.dcache.org/r/5539
Require-notes: no
Require-book: no
Acked-by: Paul
Request 2.6
Parameterize log levels and log formats

The log levels and log formats are now customizable through
dcache.conf.

New configuration properties:

dcache.log.level.file
dcache.log.level.pinboard
dcache.log.level.remote
dcache.log.level.events
dcache.log.format.file
dcache.log.format.pinboard

Target: master
Require-notes: yes
Require-book: yes
Acked-by: Albert Rossi <arossi@fnal.gov>
Patch: http://rb.dcache.org/r/5530/
Remove version number handling for SVN

Since we no longer use SVN, we can simplify our Maven
project by not supporting SVN revision numbers.

Target: trunk
Require-notes: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/5532/
ftp: Log CertPath in case CertPath validation fails

Addresses the issue that if authentication fails with a certificate
chain validation error, the error message contains absolutely no
information about the certificate that triggered the failure.

Requires https://github.com/gbehrmann/JGlobus/tree/feature/certpathvalidationexception_includes_certpath

Target: trunk
Request: 2.6
Request: 2.5
Request: 2.2-sha2
Require-notes: yes
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/5543/