axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Veithen (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (AXIS2-4358) Faulty code while creating _axis2 temp folder!
Date Thu, 28 May 2009 22:41:45 GMT

     [ https://issues.apache.org/jira/browse/AXIS2-4358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andreas Veithen resolved AXIS2-4358.
------------------------------------

    Resolution: Invalid

A non writable directory exposed as javax.servlet.context.tempdir clearly violates the servlet
specs. Either there is a problem with the servlet container (bug or misconfiguration) or you
changed the Java security policy in a way that breaks the servlet specs. In both cases it's
not a problem in Axis2. It should also be noted that falling back to java.io.tmpdir is a bad
idea because it's less safe than javax.servlet.context.tempdir. See section SRV.3.7.1 of the
servlet specs (version 2.4) for more information.

> Faulty code while creating _axis2 temp folder!
> ----------------------------------------------
>
>                 Key: AXIS2-4358
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4358
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: deployment
>    Affects Versions: 1.4.1
>            Reporter: Q
>            Priority: Blocker
>
> The following code is faulty when there is no write access - this happens expecially
on Unix based environments! 
> The first f.mkdirs() is throwing an exception and the recovery else is never called!

>   164               File f = new File((File) config.getServletContext().getAttribute("javax.servlet.context.tempdir"),
"_axis2");
>   165               if (f.exists() || f.mkdirs()) {
>   166                   param.setValue(f);
>   167               } else {
>   168                   f = new File(System.getProperty("java.io.tmpdir"), "_axis2");
>   169                   if (f.exists() || f.mkdirs()) {
>   170                       param.setValue(f);
>   171                   } else {
>   172                       throw new DeploymentException("Unable to create a temporary
working directory");
>   173                   }
>   174               }
> java.security.AccessControlException: access denied (java.io.FilePermission /opt/glassfish/nodeagents/s4-nodeagent/cluster1s4/generated/jsp/j2ee-apps/C1-axis2/axis2_war/_axis2
write)
> 	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
> 	at java.security.AccessController.checkPermission(AccessController.java:546)
> 	at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> 	at java.lang.SecurityManager.checkWrite(SecurityManager.java:962)
> 	at java.io.File.mkdir(File.java:1155)
> 	at java.io.File.mkdirs(File.java:1184)
> 	at org.apache.axis2.deployment.WarBasedAxisConfigurator.<init>(WarBasedAxisConfigurator.java:165)
> 	at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:516)
> 	at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:436)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:276)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
> 	at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:309)
> 	at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:192)
> 	at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:145)
> 	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)
> 	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1007)
> 	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4808)
> 	at org.apache.catalina.core.StandardContext.start(StandardContext.java:5196)
> 	at com.sun.enterprise.web.WebModule.start(WebModule.java:326)
> 	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:973)
> 	at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:148)
> 	at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:170)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:955)
> 	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:688)
> 	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1584)
> 	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1222)
> 	at com.sun.enterprise.web.WebContainer.loadJ2EEApplicationWebModules(WebContainer.java:1147)
> 	at com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicationLoader.java:141)
> 	at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:244)
> 	at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:336)
> 	at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:210)
> 	at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:645)
> 	at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:928)
> 	at com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:912)
> 	at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:461)
> 	at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:176)
> 	at com.sun.enterprise.ee.admin.mbeans.ServerRuntimeMBean.forwardEvent(ServerRuntimeMBean.java:95)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:375)
> 	at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:358)
> 	at com.sun.enterprise.admin.runtime.BaseRuntimeMBean.invoke(BaseRuntimeMBean.java:462)
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
> 	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
> 	at sun.reflect.GeneratedMethodAccessor59.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
> 	at $Proxy1.invoke(Unknown Source)
> 	at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
> 	at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:174)
> 	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1426)
> 	at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
> 	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1264)
> 	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1359)
> 	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
> 	at sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:159)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> 	at java.lang.Thread.run(Thread.java:619)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message