Skip to content

Commit

Permalink
ftp: log failures to wrap/encrypt responses
Browse files Browse the repository at this point in the history
Motivation:

A support ticket points to a FTP response being lost.  Although there is
no evidence pointing to a problem encrypting the response, this could
explain the apparent behaviour and we currently have no way to exclude
that possibility.

Modification:

Log if the FTP door is unable to encrypt a response.

Result:

A possible failure mode when the FTP door is replying is logged, to aid
diagnosing problems.

Target: master
Request: 4.1
Request: 4.0
Request: 3.2
Request: 3.1
Request: 3.0
Request: 2.16
Require-notes: yes
Require-book: no
Ticket: http://rt.dcache.org/Ticket/Display.html?id=9392
Acked-by: Albert Rossi
Acked-by: Jürgen Starek (verbally)
  • Loading branch information
paulmillar committed Apr 30, 2018
1 parent 1bb68a8 commit 5c96cc5
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -78,11 +78,11 @@ public GssFtpDoorV1(String ftpDoorName, String gssFlavor, DssContextFactory dssC
@Override
protected void secure_reply(CommandRequest request, String answer, String code)
{
answer = answer + "\r\n";
byte[] data = answer.getBytes(StandardCharsets.UTF_8);
byte[] data = (answer + "\r\n").getBytes(StandardCharsets.UTF_8);
try {
data = context.wrap(data, 0, data.length);
} catch (IOException e) {
LOGGER.error("Failed to encrypt reply '{}': {}", answer, e.toString());
reply(request.getOriginalRequest(), "500 Reply encryption error: " + e);
return;
}
Expand Down

0 comments on commit 5c96cc5

Please sign in to comment.