Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0013519Openbravo ERPA. Platformpublic2010-06-04 11:072010-09-13 12:38
iperdomo 
jpabloae 
normalminoralways
closedfixed 
202.6.30-gentoo-r5
2.50MP18 
 
Core
No
0013519: The compilation tasks should fail if are executed as root
A common pitfall on new developers using the development framework is to compile as root because of the write permission restrictions. The OS user (developer), tomcat, etc.

The compilation should fail if the OS user is root.
* Compile as root
* Restart the tomcat server
* Boom!
* Append a check on the OS user in the init task (attached a patch)
No tags attached.
diff build.xml.diff (644) 2010-06-04 11:07
https://issues.openbravo.com/file_download.php?file_id=2626&type=bug
diff disallow-root.diff (1,224) 2010-07-21 18:42
https://issues.openbravo.com/file_download.php?file_id=2793&type=bug
Issue History
2010-06-04 11:07iperdomoNew Issue
2010-06-04 11:07iperdomoAssigned To => jpabloae
2010-06-04 11:07iperdomoFile Added: build.xml.diff
2010-06-04 11:56shuehnerNote Added: 0027944
2010-06-04 11:56shuehnerIssue Monitored: shuehner
2010-06-04 14:09jpabloaeStatusnew => acknowledged
2010-07-13 10:35iperdomoNote Added: 0029248
2010-07-21 18:42jpabloaeNote Added: 0029451
2010-07-21 18:42jpabloaeFile Added: disallow-root.diff
2010-07-21 18:43jpabloaeNote Edited: 0029451bug_revision_view_page.php?bugnote_id=0029451#r608
2010-07-21 19:12iperdomoNote Added: 0029454
2010-07-27 16:41hgbotCheckin
2010-07-27 16:41hgbotNote Added: 0029612
2010-07-27 16:41hgbotStatusacknowledged => resolved
2010-07-27 16:41hgbotResolutionopen => fixed
2010-07-27 16:41hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/3cbb2e1e1ce56dd850b4ebe27400a62f4cb91563 [^]
2010-07-27 17:40hgbotCheckin
2010-07-27 17:40hgbotNote Added: 0029616
2010-07-27 23:48hudsonbotCheckin
2010-07-27 23:48hudsonbotNote Added: 0029621
2010-07-27 23:48hudsonbotCheckin
2010-07-27 23:48hudsonbotNote Added: 0029624
2010-08-23 16:29iperdomoNote Added: 0030230
2010-08-23 16:29iperdomoStatusresolved => closed
2010-09-13 12:38anonymoussf_bug_id0 => 3065151

Notes
(0027944)
shuehner   
2010-06-04 11:56   
Not sure:
Might be legitimate usecase sometimes... which we now break. On the other hand avoids the pitfall..

But there are more pitfalls like wrong java version, env not setup etc.. which are only checked by diagnostics.
(0029248)
iperdomo   
2010-07-13 10:35   
Perhaps a property defaulted to not allow compilation as root, but can be override, e.g.

ant install.source -Dallow.root=true
ant compile.deploy -Dallow.root=true
(0029451)
jpabloae   
2010-07-21 18:42   
(edited on: 2010-07-21 18:43)
I agree with adding this as a check plus optionally allowing to override it. Either by adding allow.root=true into the config/Openbravo.properties or as an argument to the ant command.

I attach patch that implements this based on Ivan's.

If you don't see any inconveniences to this I'll push it to pi the following days.

(0029454)
iperdomo   
2010-07-21 19:12   
I'm fine with the proposed changes

Cheers,
(0029612)
hgbot   
2010-07-27 16:41   
Repository: erp/devel/pi
Changeset: 3cbb2e1e1ce56dd850b4ebe27400a62f4cb91563
Author: Juan Pablo Aroztegi <juanpablo.aroztegi <at> openbravo.com>
Date: Tue Jul 27 16:39:03 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/3cbb2e1e1ce56dd850b4ebe27400a62f4cb91563 [^]

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

---
M build.xml
---
(0029616)
hgbot   
2010-07-27 17:40   
Repository: erp/devel/pi
Changeset: 73f4cd5e50abb66ebc30fa65dc6f7d70d7bc2c0f
Author: Juan Pablo Aroztegi <juanpablo.aroztegi <at> openbravo.com>
Date: Tue Jul 27 17:34:38 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/73f4cd5e50abb66ebc30fa65dc6f7d70d7bc2c0f [^]

Related to issue 13519: document allow.root in Openbravo.properties

---
M config/Openbravo.properties.template
---
(0029621)
hudsonbot   
2010-07-27 23:48   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/3cbb2e1e1ce5 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/5cf2bb15d5b1 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17927.obx [^]
(0029624)
hudsonbot   
2010-07-27 23:48   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/73f4cd5e50ab [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/5cf2bb15d5b1 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17927.obx [^]
(0030230)
iperdomo   
2010-08-23 16:29   
Tested on pi @ rev d1ae61b55653

This is the error message:

init:

BUILD FAILED
/home/iperdomo/src/openbravo/working/pi/build.xml:319: Don't run ant tasks with the root user

Total time: 12 seconds