You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ve...@apache.org on 2009/08/15 02:15:24 UTC

svn commit: r804413 - in /webservices/axis2/trunk/java/modules: distribution/src/main/assembly/bin-assembly.xml distribution/src/main/files/ distribution/src/main/files/conf/ distribution/src/main/files/conf/axis2.policy tool/script/axis2server.sh

Author: veithen
Date: Sat Aug 15 00:15:24 2009
New Revision: 804413

URL: http://svn.apache.org/viewvc?rev=804413&view=rev
Log:
Added an option to run the Axis2 standalone server with Java 2 security enabled. (Will change the .bat script when I get access to a Windows machine)

Added:
    webservices/axis2/trunk/java/modules/distribution/src/main/files/
    webservices/axis2/trunk/java/modules/distribution/src/main/files/conf/
    webservices/axis2/trunk/java/modules/distribution/src/main/files/conf/axis2.policy   (with props)
Modified:
    webservices/axis2/trunk/java/modules/distribution/src/main/assembly/bin-assembly.xml
    webservices/axis2/trunk/java/modules/tool/script/axis2server.sh

Modified: webservices/axis2/trunk/java/modules/distribution/src/main/assembly/bin-assembly.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/distribution/src/main/assembly/bin-assembly.xml?rev=804413&r1=804412&r2=804413&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/distribution/src/main/assembly/bin-assembly.xml (original)
+++ webservices/axis2/trunk/java/modules/distribution/src/main/assembly/bin-assembly.xml Sat Aug 15 00:15:24 2009
@@ -57,7 +57,7 @@
         </fileSet>
 
         <!--********************** creating the conf ********************** -->
-        <!-- copy the axis2.xml into conf directoy -->
+        <!-- copy axis2.xml and axis2.policy into conf directoy -->
         <fileSet>
             <directory>../../modules/kernel/conf</directory>
             <outputDirectory>conf</outputDirectory>
@@ -65,6 +65,10 @@
                 <include>axis2.xml</include>
             </includes>
         </fileSet>
+        <fileSet>
+            <directory>src/main/files/conf</directory>
+            <outputDirectory>conf</outputDirectory>
+        </fileSet>
 
         <!--********************** creating the webappp ********************** -->
         <!-- copy the web.xml into webapp/WEB-INF directory -->

Added: webservices/axis2/trunk/java/modules/distribution/src/main/files/conf/axis2.policy
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/distribution/src/main/files/conf/axis2.policy?rev=804413&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/distribution/src/main/files/conf/axis2.policy (added)
+++ webservices/axis2/trunk/java/modules/distribution/src/main/files/conf/axis2.policy Sat Aug 15 00:15:24 2009
@@ -0,0 +1,10 @@
+grant codeBase "file:${axis2.home}/lib/-" {
+    permission java.io.FilePermission "${axis2.home}", "read,write";
+    permission java.io.FilePermission "${axis2.home}/-", "read,write";
+    permission java.io.FilePermission "${java.io.tmpdir}", "read";
+    permission java.io.FilePermission "${java.io.tmpdir}/-", "read,write,delete";
+    permission java.io.FilePermission "${java.home}/lib/wsdl.properties", "read";
+    permission java.net.SocketPermission "*", "resolve,connect,listen,accept";
+    permission java.lang.RuntimePermission "*";
+    permission java.util.PropertyPermission "*", "read";
+};

Propchange: webservices/axis2/trunk/java/modules/distribution/src/main/files/conf/axis2.policy
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axis2/trunk/java/modules/tool/script/axis2server.sh
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/script/axis2server.sh?rev=804413&r1=804412&r2=804413&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/script/axis2server.sh (original)
+++ webservices/axis2/trunk/java/modules/tool/script/axis2server.sh Sat Aug 15 00:15:24 2009
@@ -32,30 +32,33 @@
 # Get the context and from that find the location of setenv.sh
 . `dirname $0`/setenv.sh
 
+JAVA_OPTS=""
 while [ $# -ge 1 ]; do
-
-if [ "$1" = "-xdebug" ]; then
-    XDEBUG="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8000"
-    shift
-
-elif [ "$1" = "-h" ]; then
-    echo "Usage: axis2server.sh"
-    echo "commands:"
-    echo "  -xdebug            Start Axis2 Server under JPDA debugger"
-    echo "  -h                 help"
-    shift
-    exit 0
-
-  else
-    echo "Error: unknown command:$1"
-    echo "For help: axis2server.sh -h"
-    shift
-    exit 1
-  fi
-
+    case $1 in
+        -xdebug)
+            JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8000"
+            shift
+        ;;
+        -security)
+            JAVA_OPTS="$JAVA_OPTS -Djava.security.manager -Djava.security.policy=$AXIS2_HOME/conf/axis2.policy -Daxis2.home=$AXIS2_HOME"
+            shift
+        ;;
+        -h)
+            echo "Usage: axis2server.sh"
+            echo "commands:"
+            echo "  -xdebug    Start Axis2 Server under JPDA debugger"
+            echo "  -security  Enable Java 2 security"
+            echo "  -h         help"
+            shift
+            exit 0
+        ;;
+        *)
+            echo "Error: unknown command:$1"
+            echo "For help: axis2server.sh -h"
+            shift
+            exit 1
+    esac
 done
 
-
-
-java $XDEBUG -classpath "$AXIS2_CLASSPATH" org.apache.axis2.transport.SimpleAxis2Server \
-	-repo "$AXIS2_HOME"/repository -conf "$AXIS2_HOME"/conf/axis2.xml $*
+java $JAVA_OPTS -classpath "$AXIS2_CLASSPATH" org.apache.axis2.transport.SimpleAxis2Server \
+    -repo "$AXIS2_HOME"/repository -conf "$AXIS2_HOME"/conf/axis2.xml $*