Skip to content

Commit

Permalink
Fix webswing detection
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Bennetts <psiinon@gmail.com>
  • Loading branch information
psiinon committed Nov 24, 2021
1 parent ba55831 commit 3cd6ad1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions zap/src/main/java/org/parosproxy/paros/Constant.java
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,9 @@ public final class Constant {
public static final String FLATPAK_NAME = "flatpak";
private static final String SNAP_FILE = "meta/snap.yaml";
public static final String SNAP_NAME = "snapcraft";
private static final String WEBSWING_ENVVAR = "WEBSWING_VERSION";
private static final String HOME_ENVVAR = "HOME";
public static final String WEBSWING_NAME = "webswing";
public static final String KALI_NAME = "kali";

//
// Home dir for ZAP, i.e. where the config file is. Can be set on cmdline, otherwise will be set
Expand Down Expand Up @@ -1604,7 +1605,8 @@ public static boolean isInContainer() {
File snapFile = new File(SNAP_FILE);
if (isLinux() && containerFile.exists()) {
inContainer = true;
boolean inWebSwing = System.getenv(WEBSWING_ENVVAR) != null;
String home = System.getenv(HOME_ENVVAR);
boolean inWebSwing = home != null && home.contains(WEBSWING_NAME);
try {
containerName =
new String(
Expand Down

0 comments on commit 3cd6ad1

Please sign in to comment.