details:   /erp/devel/pi/rev/3cbb2e1e1ce5
changeset: 7924:3cbb2e1e1ce5
user:      Juan Pablo Aroztegi <juanpablo.aroztegi <at> openbravo.com>
date:      Tue Jul 27 16:39:03 2010 +0200
summary:   Fixes issue 13519: disallow running ant tasks as root

To override this check, two options:
1) Add the -Dallow.root=true argument to the ant command.
2) Add allow.root=true to the config/Openbravo.properties file

diffstat:

 build.xml |  20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diffs (44 lines):

diff -r ff9d8e6fe070 -r 3cbb2e1e1ce5 build.xml
--- a/build.xml Tue Jul 27 17:11:31 2010 +0530
+++ b/build.xml Tue Jul 27 16:39:03 2010 +0200
@@ -177,6 +177,13 @@
     </or>
   </condition>
 
+  <condition property="allow.root.user" value="true" else="false">
+    <or>
+      <equals arg1="yes" arg2="${allow.root}" />
+      <equals arg1="true" arg2="${allow.root}" />
+    </or>
+  </condition>
+
   <condition property="no.java.home" value="true">
     <not>
       <isset property="env.JAVA_HOME" />
@@ -188,7 +195,17 @@
       <equals arg1="${bbdd.rdbms}" arg2="POSTGRE" />
     </and>
   </condition>
- 
+
+  <condition property="root.user">
+    <and>
+      <equals arg1="${user.name}" arg2="root" />
+      <not>
+        <contains string="${os.name}" substring="Windows" />
+      </not>
+      <equals arg1="false" arg2="${allow.root.user}" />
+    </and>
+  </condition>
+
   <path id="project.class.path">
     <dirset dir="${base.modules}">
       <include name="*/build/classes/" />
@@ -298,6 +315,7 @@
   
   <target name="init" depends="code.rev">
     <fail if="no.java.home" message="The environment variable JAVA_HOME is not 
set." />
+    <fail if="root.user" message="Don't run ant tasks with the root user" />
   </target>
 
   <target name="code.rev" depends="set.code.rev">

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to