Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0013519
TypeCategorySeverityReproducibilityDate SubmittedLast Update
feature request[Openbravo ERP] A. Platformminoralways2010-06-04 11:072010-09-13 12:38
ReporteriperdomoView Statuspublic 
Assigned Tojpabloae 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision3cbb2e1e1ce5
ProjectionnoneETAnoneTarget Version
OSLinux 32 bitDatabasePostgreSQLJava version1.6.0_15
OS Version2.6.30-gentoo-r5Database version8.3.8Ant version1.7.1
Product Version2.50MP18SCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0013519: The compilation tasks should fail if are executed as root

DescriptionA 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.
Steps To Reproduce* Compile as root
* Restart the tomcat server
* Boom!
Proposed Solution* Append a check on the OS user in the init task (attached a patch)
TagsNo tags attached.
Attached Filesdiff file icon build.xml.diff [^] (644 bytes) 2010-06-04 11:07 [Show Content]
diff file icon disallow-root.diff [^] (1,224 bytes) 2010-07-21 18:42 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0027944)
shuehner (administrator)
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 (reporter)
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 (reporter)
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 (reporter)
2010-07-21 19:12

I'm fine with the proposed changes

Cheers,
(0029612)
hgbot (developer)
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 (developer)
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 (developer)
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 (developer)
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 (reporter)
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

- Issue History
Date Modified Username Field Change
2010-06-04 11:07 iperdomo New Issue
2010-06-04 11:07 iperdomo Assigned To => jpabloae
2010-06-04 11:07 iperdomo File Added: build.xml.diff
2010-06-04 11:56 shuehner Note Added: 0027944
2010-06-04 11:56 shuehner Issue Monitored: shuehner
2010-06-04 14:09 jpabloae Status new => acknowledged
2010-07-13 10:35 iperdomo Note Added: 0029248
2010-07-21 18:42 jpabloae Note Added: 0029451
2010-07-21 18:42 jpabloae File Added: disallow-root.diff
2010-07-21 18:43 jpabloae Note Edited: 0029451 View Revisions
2010-07-21 19:12 iperdomo Note Added: 0029454
2010-07-27 16:41 hgbot Checkin
2010-07-27 16:41 hgbot Note Added: 0029612
2010-07-27 16:41 hgbot Status acknowledged => resolved
2010-07-27 16:41 hgbot Resolution open => fixed
2010-07-27 16:41 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/3cbb2e1e1ce56dd850b4ebe27400a62f4cb91563 [^]
2010-07-27 17:40 hgbot Checkin
2010-07-27 17:40 hgbot Note Added: 0029616
2010-07-27 23:48 hudsonbot Checkin
2010-07-27 23:48 hudsonbot Note Added: 0029621
2010-07-27 23:48 hudsonbot Checkin
2010-07-27 23:48 hudsonbot Note Added: 0029624
2010-08-23 16:29 iperdomo Note Added: 0030230
2010-08-23 16:29 iperdomo Status resolved => closed
2010-09-13 12:38 anonymous sf_bug_id 0 => 3065151


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker