aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Porter <brett@apache.org>2008-04-19 03:15:06 +0000
committerBrett Porter <brett@apache.org>2008-04-19 03:15:06 +0000
commitc2c71dd5ec06f1414decfaf588688d6b58a704a8 (patch)
tree8c8dce3e1898249a386624f7d29cd030be395cde
parent3066bec070ce2763ba65d49fb112d27f6a5e139d (diff)
downloadarchiva-c2c71dd5ec06f1414decfaf588688d6b58a704a8.tar.gz
archiva-c2c71dd5ec06f1414decfaf588688d6b58a704a8.zip
[MRM-781] correct probem with guest account
Submitted by: James William Dumay git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@649748 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java4
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProvider.java9
2 files changed, 7 insertions, 6 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java
index fb4d2e3c4..48ba64ba1 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java
@@ -121,7 +121,9 @@ public class RepositoryServlet
}
catch (DavException e) {
if (e.getErrorCode() == HttpServletResponse.SC_UNAUTHORIZED) {
- log.error("Should throw UnauthorizedDavException");
+ final String msg = "Should throw " + UnauthorizedDavException.class.getName();
+ log.error(msg);
+ webdavResponse.sendError(e.getErrorCode(), msg);
} else {
webdavResponse.sendError(e);
}
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProvider.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProvider.java
index 766426105..c0ed7bc5c 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProvider.java
+++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProvider.java
@@ -77,12 +77,11 @@ public class ArchivaDavSessionProvider implements DavSessionProvider
// Authentication Tests.
try
{
- AuthenticationResult result = httpAuth.getAuthenticationResult(request, null);
+ AuthenticationResult result = httpAuth.getAuthenticationResult( request, null );
- if ( result == null || !result.isAuthenticated() )
+ if ( result != null && !result.isAuthenticated() )
{
- //Unfortunatly, the DavSessionProvider does not pass in the response
- httpAuth.authenticate(request, null);
+ throw new UnauthorizedDavException(repositoryId, "User Credentials Invalid");
}
}
catch ( AuthenticationException e )
@@ -130,7 +129,7 @@ public class ArchivaDavSessionProvider implements DavSessionProvider
",permission=" + permission + ",repo=" + repositoryId + "] : " +
authzResult.getException().getMessage() );
}
- throw new DavException(HttpServletResponse.SC_UNAUTHORIZED, "Access denied for repository " + repositoryId);
+ throw new UnauthorizedDavException(repositoryId, "Access denied for repository " + repositoryId);
}
}
catch ( AuthorizationException e )