From b6167fc868661c4959b29c3305aaaed0b541bbc0 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 6 Jun 2024 12:29:35 +0200 Subject: Also deny listing public images in R/O mode --- .../org/openslx/imagemaster/serverconnection/IncomingTransfer.java | 2 ++ .../org/openslx/imagemaster/thrift/server/MasterServerHandler.java | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/main/java/org/openslx/imagemaster/serverconnection/IncomingTransfer.java b/src/main/java/org/openslx/imagemaster/serverconnection/IncomingTransfer.java index 0950d52..d0bb386 100644 --- a/src/main/java/org/openslx/imagemaster/serverconnection/IncomingTransfer.java +++ b/src/main/java/org/openslx/imagemaster/serverconnection/IncomingTransfer.java @@ -51,6 +51,7 @@ public class IncomingTransfer extends IncomingTransferBase } catch ( SQLException e ) { } } + LOGGER.info( "Incoming transfer started" ); } @Override @@ -84,6 +85,7 @@ public class IncomingTransfer extends IncomingTransferBase } catch ( SQLException e ) { // Nothing to do } + LOGGER.info( "Incoming transfer ended" ); return true; } diff --git a/src/main/java/org/openslx/imagemaster/thrift/server/MasterServerHandler.java b/src/main/java/org/openslx/imagemaster/thrift/server/MasterServerHandler.java index 19ad7e6..7138111 100644 --- a/src/main/java/org/openslx/imagemaster/thrift/server/MasterServerHandler.java +++ b/src/main/java/org/openslx/imagemaster/thrift/server/MasterServerHandler.java @@ -140,6 +140,10 @@ public class MasterServerHandler implements MasterServer.Iface public List getPublicImages( String sessionId, int page ) throws TAuthorizationException, TInvocationException { + if ( Globals.isReadOnlyMode() ) { + throw new TInvocationException( InvocationError.INTERNAL_SERVER_ERROR, + "This is a read-only failover master-server. Image up-/downloads are not available." ); + } Session session = SessionManager.getSessionFromSessionId( sessionId ); if ( session == null ) throw new TAuthorizationException( AuthorizationError.NOT_AUTHENTICATED, "Session ID not valid" ); -- cgit v1.2.3-55-g7522