Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--jetty-setuid/jetty-setuid-java/src/main/java/org/eclipse/jetty/setuid/SetUIDListener.java4
-rw-r--r--jetty-setuid/jetty-setuid-java/src/main/java/org/eclipse/jetty/setuid/SetUIDServer.java4
2 files changed, 8 insertions, 0 deletions
diff --git a/jetty-setuid/jetty-setuid-java/src/main/java/org/eclipse/jetty/setuid/SetUIDListener.java b/jetty-setuid/jetty-setuid-java/src/main/java/org/eclipse/jetty/setuid/SetUIDListener.java
index 7247b26..499fe3d 100644
--- a/jetty-setuid/jetty-setuid-java/src/main/java/org/eclipse/jetty/setuid/SetUIDListener.java
+++ b/jetty-setuid/jetty-setuid-java/src/main/java/org/eclipse/jetty/setuid/SetUIDListener.java
@@ -153,6 +153,10 @@ public class SetUIDListener implements LifeCycle.Listener
public void lifeCycleStarting(LifeCycle lifecycle)
{
+ String jettyUserEnvVariable = System.getenv("JETTY_USER");
+ if (jettyUserEnvVariable != null)
+ LOG.warn("JETTY_USER set to: {}. If JETTY_USER is set, starting jetty as root and using " +
+ "jetty-setuid to switch user won't work!!!", jettyUserEnvVariable);
if (_umask > -1)
{
LOG.info("Setting umask=0" + Integer.toString(_umask,8));
diff --git a/jetty-setuid/jetty-setuid-java/src/main/java/org/eclipse/jetty/setuid/SetUIDServer.java b/jetty-setuid/jetty-setuid-java/src/main/java/org/eclipse/jetty/setuid/SetUIDServer.java
index 25e0b06..42f50f9 100644
--- a/jetty-setuid/jetty-setuid-java/src/main/java/org/eclipse/jetty/setuid/SetUIDServer.java
+++ b/jetty-setuid/jetty-setuid-java/src/main/java/org/eclipse/jetty/setuid/SetUIDServer.java
@@ -124,6 +124,10 @@ public class SetUIDServer extends Server
@Override
protected void doStart() throws Exception
{
+ String jettyUserEnvVariable = System.getenv("JETTY_USER");
+ if (jettyUserEnvVariable != null)
+ LOG.warn("JETTY_USER set to: {}. If JETTY_USER is set, starting jetty as root and using " +
+ "jetty-setuid to switch user won't work!!!", jettyUserEnvVariable);
if (_umask > -1)
{
LOG.info("Setting umask=0" + Integer.toString(_umask,8));

Back to the top