Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0009274Openbravo ERPA. Platformpublic2009-06-01 19:002009-06-27 00:00
alostale 
marvintm 
urgentmajoralways
closedfixed 
5
pi 
main 
Core
No
0009274: export.database security mechanism does not work properly with mercurial.
export.database security mechanism does not work properly with mercurial.

The problem is the mercurial changes the revision for the whole working copy for each commit, and the security mechanism does not allow to export database in case the revision in the repository does not match with the one in database (which is updated whenever a create.database or update.database is executed).
In a hg working copy:
-Create database
-Do modifications in db
-export database -> it works fine
-commit changes -> the working copy revision changes
-export database -> it is not possible since the revisions do not match
The security mechanism should be defined as:
-If revision numbers match export
-If they do not match, look all the revisions in src-db/database after the one in db. If all the revisions are done by the user trying to export allow it other case deny it-
No tags attached.
Issue History
2009-06-01 19:00alostaleNew Issue
2009-06-01 19:00alostaleAssigned To => marvintm
2009-06-02 12:15iciordiaNote Added: 0016858
2009-06-05 13:12psarobeStatusnew => scheduled
2009-06-05 13:12psarobefix_in_branch => pi
2009-06-15 12:36hgbotCheckin
2009-06-15 12:36hgbotNote Added: 0017298
2009-06-15 12:36hgbotStatusscheduled => resolved
2009-06-15 12:36hgbotResolutionopen => fixed
2009-06-15 12:37hgbotCheckin
2009-06-15 12:37hgbotNote Added: 0017299
2009-06-15 12:37hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/3b46e2f1f313c24203dd3354015d82340addba25 [^]
2009-06-22 11:09psarobeFixed in Version => main
2009-06-26 18:39psarobeStatusresolved => closed
2009-06-27 00:00anonymoussf_bug_id0 => 2813023

Notes
(0016858)
iciordia   
2009-06-02 12:15   
Simpler (and better :-) proposed solution:
DBSourceManager synchronizes database and xml files using two tasks: update.database (db is sync with model in xml files) and export.database (xml files are sync with model in db).

After every synchonization the system saves in db the date/time and CRC of xml files in model of that synchronization.

When executing update.database the system checks that no change have happened in db after last synchronization (current behaviour, nothing to do)

When executing export.database the system checks that no change have happened in xml files (by comparing crc) after last synchronization (symetric to update.database check).

Ismael
(0017298)
hgbot   
2009-06-15 12:36   
Repository: dbsourcemanager
Revision: 337
Author: marvintm
Date: 2009-06-15 12:36:35 +0200 (Mon, 15 Jun 2009)

Fixed issue 9274. Now the security mechanism for export.database will compare the CRC from the files, instead of using the Mercurial revision.

---
U trunk/src/org/openbravo/ddlutils/task/AlterDatabaseDataAll.java
U trunk/src/org/openbravo/ddlutils/task/ExportDatabase.java
U trunk/src/org/openbravo/ddlutils/util/DBSMOBUtil.java
---

https://dev.openbravo.com/websvn/dbsourcemanager/?rev=337&sc=1 [^]
(0017299)
hgbot   
2009-06-15 12:37   
Repository: erp/devel/pi
Changeset: 3b46e2f1f313c24203dd3354015d82340addba25
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Mon Jun 15 12:36:43 2009 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/3b46e2f1f313c24203dd3354015d82340addba25 [^]

Fixed issue 9274. Now the security mechanism for export.database will compare the CRC from the files, instead of using the Mercurial revision.

---
M src-core/src/org/openbravo/utils/CheckSum.java
M src-db/database/lib/dbsourcemanager.jar
---