|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mortbay.component.AbstractLifeCycle
org.mortbay.jetty.handler.AbstractHandler
org.mortbay.jetty.handler.AbstractHandlerContainer
org.mortbay.jetty.handler.HandlerWrapper
org.mortbay.jetty.Server
org.mortbay.setuid.SetUIDServer
public class SetUIDServer
This extension of Server
will make a JNI call to set the unix UID.
This can be used to start the server as root so that privileged ports may
be accessed and then switch to a non-root user for security.
Depending on the value of setStartServerAsPrivileged(boolean)
, either the
server will be started and then the UID set; or the Server.getConnectors()
will be
opened with a call to Connector.open()
, the UID set and then the server is started.
The later is the default and avoids any webapplication code being run as a privileged user,
but will not work if the application code also needs to open privileged ports.
The configured umask is set before the server is started and the configured uid is set after the server is started.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.mortbay.jetty.Server |
---|
org.mortbay.jetty.Server.Graceful |
Nested classes/interfaces inherited from interface org.mortbay.component.LifeCycle |
---|
org.mortbay.component.LifeCycle.Listener |
Field Summary |
---|
Fields inherited from class org.mortbay.jetty.Server |
---|
SNAPSHOT_VERSION, UNKNOWN_VERSION |
Fields inherited from class org.mortbay.jetty.handler.AbstractHandler |
---|
_string |
Fields inherited from class org.mortbay.component.AbstractLifeCycle |
---|
_listeners |
Fields inherited from interface org.mortbay.jetty.Handler |
---|
ALL, DEFAULT, ERROR, FORWARD, INCLUDE, REQUEST |
Constructor Summary | |
---|---|
SetUIDServer()
|
Method Summary | |
---|---|
protected void |
doStart()
|
int |
getGid()
|
String |
getGroupname()
|
RLimit |
getRLimitNoFiles()
|
int |
getUid()
|
int |
getUmask()
|
String |
getUsername()
|
boolean |
isStartServerAsPrivileged()
|
void |
setGid(int gid)
|
void |
setGroupname(String groupname)
|
void |
setRLimitNoFiles(RLimit rlimit)
|
void |
setStartServerAsPrivileged(boolean startContextsAsPrivileged)
|
void |
setUid(int uid)
|
void |
setUmask(int umask)
|
void |
setUsername(String username)
|
Methods inherited from class org.mortbay.jetty.Server |
---|
addConnector, addHandler, addLifeCycle, addUserRealm, clearAttributes, doStop, getAttribute, getAttributeNames, getConnectors, getContainer, getGracefulShutdown, getHandlers, getSendDateHeader, getSendServerVersion, getSessionIdManager, getStopAtShutdown, getThreadPool, getUserRealms, getVersion, handle, join, removeAttribute, removeConnector, removeHandler, removeLifeCycle, removeUserRealm, setAttribute, setConnectors, setGracefulShutdown, setHandlers, setSendDateHeader, setSendServerVersion, setSessionIdManager, setStopAtShutdown, setThreadPool, setUserRealms |
Methods inherited from class org.mortbay.jetty.handler.HandlerWrapper |
---|
expandChildren, getHandler, handle, setHandler, setServer |
Methods inherited from class org.mortbay.jetty.handler.AbstractHandlerContainer |
---|
expandHandler, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass |
Methods inherited from class org.mortbay.jetty.handler.AbstractHandler |
---|
destroy, getServer, toString |
Methods inherited from class org.mortbay.component.AbstractLifeCycle |
---|
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.mortbay.component.LifeCycle |
---|
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
Constructor Detail |
---|
public SetUIDServer()
Method Detail |
---|
public void setUsername(String username)
public String getUsername()
public void setGroupname(String groupname)
public String getGroupname()
public int getUmask()
public void setUmask(int umask)
public int getUid()
public void setUid(int uid)
public void setGid(int gid)
public int getGid()
public void setRLimitNoFiles(RLimit rlimit)
public RLimit getRLimitNoFiles()
protected void doStart() throws Exception
doStart
in class org.mortbay.jetty.Server
Exception
public boolean isStartServerAsPrivileged()
public void setStartServerAsPrivileged(boolean startContextsAsPrivileged)
startServerAsPrivileged
- if true, the server is started and then the process UID is switched. If false, the connectors are opened, the UID is switched and then the server is started.Connector#open()}
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |