[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
This commit is contained in:
Brett Porter 2008-04-19 03:15:06 +00:00
parent 3066bec070
commit c2c71dd5ec
2 changed files with 7 additions and 6 deletions

View File

@ -121,7 +121,9 @@ public class RepositoryServlet
} }
catch (DavException e) { catch (DavException e) {
if (e.getErrorCode() == HttpServletResponse.SC_UNAUTHORIZED) { 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 { } else {
webdavResponse.sendError(e); webdavResponse.sendError(e);
} }

View File

@ -79,10 +79,9 @@ public class ArchivaDavSessionProvider implements DavSessionProvider
{ {
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 throw new UnauthorizedDavException(repositoryId, "User Credentials Invalid");
httpAuth.authenticate(request, null);
} }
} }
catch ( AuthenticationException e ) catch ( AuthenticationException e )
@ -130,7 +129,7 @@ public class ArchivaDavSessionProvider implements DavSessionProvider
",permission=" + permission + ",repo=" + repositoryId + "] : " + ",permission=" + permission + ",repo=" + repositoryId + "] : " +
authzResult.getException().getMessage() ); 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 ) catch ( AuthorizationException e )