aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2013-06-11 04:34:49 (EDT)
committerThomas Becker2013-06-11 04:34:49 (EDT)
commit0566423e6d11c6bd0c6684cb362e514b0d6304b0 (patch)
tree6cb70f6be429a31daabea42db7082beba80ad9ad
parentaab91ec3afd6bb12bd34ef3e20b88782bb16b971 (diff)
downloadorg.eclipse.jetty.toolchain-0566423e6d11c6bd0c6684cb362e514b0d6304b0.zip
org.eclipse.jetty.toolchain-0566423e6d11c6bd0c6684cb362e514b0d6304b0.tar.gz
org.eclipse.jetty.toolchain-0566423e6d11c6bd0c6684cb362e514b0d6304b0.tar.bz2
410205 add general warning message when JETTY_USER is set in jetty-setuid
-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));