From 4ecc55443a792c0a5cc28c6f67abe1a551a07f7c Mon Sep 17 00:00:00 2001 From: crschnick Date: Mon, 17 Mar 2025 06:43:34 +0000 Subject: [PATCH] Fix stackoverflow for some elevation requests --- .../main/java/io/xpipe/app/util/BaseElevationHandler.java | 5 ++--- .../main/java/io/xpipe/core/process/ElevationHandler.java | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/util/BaseElevationHandler.java b/app/src/main/java/io/xpipe/app/util/BaseElevationHandler.java index 8c42d4165..3ce77ff17 100644 --- a/app/src/main/java/io/xpipe/app/util/BaseElevationHandler.java +++ b/app/src/main/java/io/xpipe/app/util/BaseElevationHandler.java @@ -3,7 +3,6 @@ package io.xpipe.app.util; import io.xpipe.app.storage.DataStorage; import io.xpipe.core.process.CountDown; import io.xpipe.core.process.ElevationHandler; -import io.xpipe.core.process.ShellControl; import io.xpipe.core.store.DataStore; import io.xpipe.core.util.SecretReference; @@ -21,7 +20,7 @@ public class BaseElevationHandler implements ElevationHandler { } @Override - public boolean handleRequest(ShellControl parent, UUID requestId, CountDown countDown, boolean confirmIfNeeded) { + public boolean handleRequest(UUID requestId, CountDown countDown, boolean confirmIfNeeded, boolean interactive) { var ref = getSecretRef(); if (ref == null) { return false; @@ -35,7 +34,7 @@ public class BaseElevationHandler implements ElevationHandler { List.of(), List.of(), countDown, - parent.isInteractive()); + interactive); return true; } diff --git a/core/src/main/java/io/xpipe/core/process/ElevationHandler.java b/core/src/main/java/io/xpipe/core/process/ElevationHandler.java index 42a6741ae..ba4f922f6 100644 --- a/core/src/main/java/io/xpipe/core/process/ElevationHandler.java +++ b/core/src/main/java/io/xpipe/core/process/ElevationHandler.java @@ -11,9 +11,9 @@ public interface ElevationHandler { @Override public boolean handleRequest( - ShellControl parent, UUID requestId, CountDown countDown, boolean confirmIfNeeded) { - var r = ElevationHandler.this.handleRequest(parent, requestId, countDown, confirmIfNeeded); - return r || other.handleRequest(parent, requestId, countDown, confirmIfNeeded); + UUID requestId, CountDown countDown, boolean confirmIfNeeded, boolean interactive) { + var r = ElevationHandler.this.handleRequest(requestId, countDown, confirmIfNeeded, interactive); + return r || other.handleRequest(requestId, countDown, confirmIfNeeded, interactive); } @Override @@ -24,7 +24,7 @@ public interface ElevationHandler { }; } - boolean handleRequest(ShellControl parent, UUID requestId, CountDown countDown, boolean confirmIfNeeded); + boolean handleRequest(UUID requestId, CountDown countDown, boolean confirmIfNeeded, boolean interactive); SecretReference getSecretRef(); }