Skip to content

Commit

Permalink
webdav: log why request is rejected with permission denied
Browse files Browse the repository at this point in the history
Certain configuration can lead to a user's request being rejected
inside the webdav door.  These are currently either not logged or
logged with limited information.  Either way, it is hard to
understand why a request is failing.

Target: master
Request: 2.7
Request: 2.6
Request: 2.2
Patch: http://rb.dcache.org/r/6319/
Acked-by: Gerd Behrmann
  • Loading branch information
paulmillar committed Dec 9, 2013
1 parent 143b96c commit 2ff8818
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -85,6 +85,8 @@ public void process(final FilterChain filterChain,
Subject subject = new Subject();

if (!isAllowedMethod(request.getMethod())) {
_log.debug("Failing {} from {} as door is read-only",
request.getMethod(), request.getRemoteAddr());
manager.getResponseHandler().respondMethodNotAllowed(new EmptyResource(request), response, request);
return;
}
Expand All @@ -100,7 +102,8 @@ public void process(final FilterChain filterChain,
subject = login.getSubject();

if (!isAuthorizedMethod(request.getMethod(), login)) {
throw new PermissionDeniedCacheException("Permission denied");
throw new PermissionDeniedCacheException("Permission denied: " +
"read-only user");
}

checkRootPath(request, login);
Expand Down Expand Up @@ -164,7 +167,8 @@ private void checkRootPath(Request request, LoginReply login) throws CacheExcept
FsPath fullPath = new FsPath(_rootPath, new FsPath(path));
if (!fullPath.startsWith(userRoot)) {
if (!path.equals("/")) {
throw new PermissionDeniedCacheException("Permission denied");
throw new PermissionDeniedCacheException("Permission denied: " +
"path outside user's root");
}

try {
Expand Down

0 comments on commit 2ff8818

Please sign in to comment.