You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(57) |
Apr
(103) |
May
(164) |
Jun
(139) |
Jul
(173) |
Aug
(196) |
Sep
(221) |
Oct
(333) |
Nov
(214) |
Dec
(88) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(163) |
Feb
(165) |
Mar
(98) |
Apr
(93) |
May
(199) |
Jun
(118) |
Jul
(200) |
Aug
(212) |
Sep
(185) |
Oct
(297) |
Nov
(437) |
Dec
(272) |
2006 |
Jan
(542) |
Feb
(329) |
Mar
(267) |
Apr
(332) |
May
(267) |
Jun
(130) |
Jul
(161) |
Aug
(348) |
Sep
(166) |
Oct
(305) |
Nov
(173) |
Dec
(173) |
2007 |
Jan
(199) |
Feb
(118) |
Mar
(133) |
Apr
(200) |
May
(208) |
Jun
(146) |
Jul
(198) |
Aug
(146) |
Sep
(187) |
Oct
(182) |
Nov
(181) |
Dec
(83) |
2008 |
Jan
(252) |
Feb
(124) |
Mar
(124) |
Apr
(101) |
May
(143) |
Jun
(122) |
Jul
(129) |
Aug
(60) |
Sep
(80) |
Oct
(89) |
Nov
(54) |
Dec
(112) |
2009 |
Jan
(88) |
Feb
(145) |
Mar
(105) |
Apr
(164) |
May
(123) |
Jun
(154) |
Jul
(374) |
Aug
(341) |
Sep
(219) |
Oct
(137) |
Nov
(373) |
Dec
(240) |
2010 |
Jan
(197) |
Feb
(270) |
Mar
(253) |
Apr
(150) |
May
(102) |
Jun
(51) |
Jul
(300) |
Aug
(512) |
Sep
(254) |
Oct
(258) |
Nov
(288) |
Dec
(143) |
2011 |
Jan
(238) |
Feb
(179) |
Mar
(253) |
Apr
(332) |
May
(248) |
Jun
(255) |
Jul
(216) |
Aug
(282) |
Sep
(146) |
Oct
(77) |
Nov
(86) |
Dec
(69) |
2012 |
Jan
(172) |
Feb
(234) |
Mar
(229) |
Apr
(101) |
May
(212) |
Jun
(267) |
Jul
(129) |
Aug
(210) |
Sep
(239) |
Oct
(271) |
Nov
(368) |
Dec
(220) |
2013 |
Jan
(179) |
Feb
(155) |
Mar
(59) |
Apr
(47) |
May
(99) |
Jun
(158) |
Jul
(185) |
Aug
(16) |
Sep
(16) |
Oct
(7) |
Nov
(20) |
Dec
(12) |
2014 |
Jan
(21) |
Feb
(17) |
Mar
(18) |
Apr
(13) |
May
(27) |
Jun
(15) |
Jul
(19) |
Aug
(22) |
Sep
(30) |
Oct
(16) |
Nov
(19) |
Dec
(16) |
2015 |
Jan
(14) |
Feb
(24) |
Mar
(33) |
Apr
(41) |
May
(14) |
Jun
(80) |
Jul
(53) |
Aug
(8) |
Sep
(7) |
Oct
(15) |
Nov
(13) |
Dec
(2) |
2016 |
Jan
(22) |
Feb
(12) |
Mar
(30) |
Apr
(6) |
May
(33) |
Jun
(16) |
Jul
(8) |
Aug
(20) |
Sep
(12) |
Oct
(18) |
Nov
(12) |
Dec
(11) |
2017 |
Jan
(24) |
Feb
(26) |
Mar
(47) |
Apr
(23) |
May
(19) |
Jun
(14) |
Jul
(28) |
Aug
(30) |
Sep
(17) |
Oct
|
Nov
|
Dec
|
2019 |
Jan
(1) |
Feb
(73) |
Mar
(90) |
Apr
(42) |
May
(116) |
Jun
(90) |
Jul
(127) |
Aug
(103) |
Sep
(56) |
Oct
(42) |
Nov
(95) |
Dec
(58) |
2020 |
Jan
(102) |
Feb
(31) |
Mar
(93) |
Apr
(60) |
May
(57) |
Jun
(45) |
Jul
(29) |
Aug
(32) |
Sep
(44) |
Oct
(86) |
Nov
(51) |
Dec
(71) |
2021 |
Jan
(44) |
Feb
(25) |
Mar
(78) |
Apr
(130) |
May
(64) |
Jun
(74) |
Jul
(21) |
Aug
(64) |
Sep
(40) |
Oct
(43) |
Nov
(21) |
Dec
(99) |
2022 |
Jan
(154) |
Feb
(64) |
Mar
(45) |
Apr
(95) |
May
(62) |
Jun
(48) |
Jul
(73) |
Aug
(37) |
Sep
(71) |
Oct
(27) |
Nov
(40) |
Dec
(65) |
2023 |
Jan
(89) |
Feb
(130) |
Mar
(124) |
Apr
(50) |
May
(93) |
Jun
(46) |
Jul
(45) |
Aug
(68) |
Sep
(62) |
Oct
(71) |
Nov
(108) |
Dec
(82) |
2024 |
Jan
(53) |
Feb
(76) |
Mar
(64) |
Apr
(75) |
May
(36) |
Jun
(54) |
Jul
(98) |
Aug
(137) |
Sep
(58) |
Oct
(177) |
Nov
(84) |
Dec
(52) |
2025 |
Jan
(70) |
Feb
(53) |
Mar
(72) |
Apr
(47) |
May
(88) |
Jun
(49) |
Jul
(86) |
Aug
(20) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Wolfgang M. M. <wol...@us...> - 2004-07-05 20:11:00
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmldb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26880/src/org/exist/xmldb Modified Files: RemoteCollectionManagementService.java Log Message: Index: RemoteCollectionManagementService.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/RemoteCollectionManagementService.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RemoteCollectionManagementService.java 21 Jun 2004 15:46:23 -0000 1.5 --- RemoteCollectionManagementService.java 5 Jul 2004 20:10:51 -0000 1.6 *************** *** 160,164 **** } ! /* (non-Javadoc) * @see org.exist.xmldb.CollectionManagementServiceImpl#copyResource(java.lang.String, java.lang.String, java.lang.String) --- 160,171 ---- } ! /* (non-Javadoc) ! * @see org.exist.xmldb.CollectionManagementServiceImpl#copy(java.lang.String, java.lang.String, java.lang.String) ! */ ! public void copy(String collection, String destination, String newName) ! throws XMLDBException { ! throw new XMLDBException(ErrorCodes.NOT_IMPLEMENTED); ! } ! /* (non-Javadoc) * @see org.exist.xmldb.CollectionManagementServiceImpl#copyResource(java.lang.String, java.lang.String, java.lang.String) |
From: Wolfgang M. M. <wol...@us...> - 2004-07-05 20:04:12
|
Update of /cvsroot/exist/eXist-1.0/samples/xmlrpc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25674/samples/xmlrpc Modified Files: find.rb search2.pl Log Message: Changed XML-RPC query() method to accept XQuery as a binary argument instead of a string. Index: search2.pl =================================================================== RCS file: /cvsroot/exist/eXist-1.0/samples/xmlrpc/search2.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** search2.pl 19 Feb 2004 16:24:07 -0000 1.1 --- search2.pl 5 Jul 2004 20:04:04 -0000 1.2 *************** *** 25,29 **** 'highlight-matches' => 'none'); ! $req = RPC::XML::request->new("query", $query, 20, 1, $options); $response = $client->send_request($req); --- 25,29 ---- 'highlight-matches' => 'none'); ! $req = RPC::XML::request->new("query", RPC::XML::base64->new($query), 20, 1, $options); $response = $client->send_request($req); Index: find.rb =================================================================== RCS file: /cvsroot/exist/eXist-1.0/samples/xmlrpc/find.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** find.rb 1 Apr 2004 14:12:45 -0000 1.2 --- find.rb 5 Jul 2004 20:04:04 -0000 1.3 *************** *** 22,26 **** begin ! result = client.call("query", query, 20, 1, outputOptions) puts "#{result}\n" --- 22,26 ---- begin ! result = client.call("query", XMLRPC::Base64.new(query), 20, 1, outputOptions) puts "#{result}\n" |
From: Wolfgang M. M. <wol...@us...> - 2004-07-05 20:03:24
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25405/src/org/exist/collections Modified Files: Collection.java Log Message: Fixed concurrency issue in the dom.dbx node store: in some cases, a reading thread could interfere with a writing thread. As a result, some data pages got lost. Index: Collection.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/collections/Collection.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Collection.java 2 Jul 2004 16:53:53 -0000 1.33 --- Collection.java 5 Jul 2004 20:02:46 -0000 1.34 *************** *** 870,877 **** if(oldDoc == null) addDocument(broker, document); broker.addDocument(this, document); broker.closeDocument(); broker.flush(); ! // if we are running in privileged mode (e.g. backup/restore) // notify the SecurityManager about changes --- 870,878 ---- if(oldDoc == null) addDocument(broker, document); + // broker.checkTree(document); broker.addDocument(this, document); broker.closeDocument(); broker.flush(); ! LOG.debug("document stored."); // if we are running in privileged mode (e.g. backup/restore) // notify the SecurityManager about changes |
From: Wolfgang M. M. <wol...@us...> - 2004-07-05 20:03:24
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/dom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25405/src/org/exist/dom Modified Files: ElementImpl.java Log Message: Fixed concurrency issue in the dom.dbx node store: in some cases, a reading thread could interfere with a writing thread. As a result, some data pages got lost. Index: ElementImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/ElementImpl.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** ElementImpl.java 30 Jun 2004 15:56:59 -0000 1.41 --- ElementImpl.java 5 Jul 2004 20:02:46 -0000 1.42 *************** *** 67,71 **** protected short attributes = 0; protected int children = 0; - protected long firstChild = -1; protected Map namespaceMappings = null; --- 67,70 ---- *************** *** 110,114 **** public void clear() { super.clear(); - firstChild = -1; gid = 0; children = 0; --- 109,112 ---- *************** *** 498,505 **** if (gid == 0) return 0; ! if (firstChild > -1) ! return firstChild; ! firstChild = XMLUtil.getFirstChildId(ownerDocument, gid); ! return firstChild; } --- 496,500 ---- if (gid == 0) return 0; ! return XMLUtil.getFirstChildId(ownerDocument, gid); } |
From: Wolfgang M. M. <wol...@us...> - 2004-07-05 20:02:57
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25405/src/org/exist/xmlrpc Modified Files: RpcServer.java RpcAPI.java Log Message: Fixed concurrency issue in the dom.dbx node store: in some cases, a reading thread could interfere with a writing thread. As a result, some data pages got lost. Index: RpcServer.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc/RpcServer.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** RpcServer.java 21 Jun 2004 15:27:39 -0000 1.39 --- RpcServer.java 5 Jul 2004 20:02:48 -0000 1.40 *************** *** 819,829 **** * */ ! public String query(User user, String xpath, int howmany, int start, Hashtable parameters) throws EXistException, PermissionDeniedException { RpcConnection con = pool.get(); String result = null; try { ! result = con.query(user, xpath, howmany, start, parameters); return result; } catch (Exception e) { --- 819,836 ---- * */ ! public String query(User user, byte[] xquery, int howmany, int start, Hashtable parameters) throws EXistException, PermissionDeniedException { RpcConnection con = pool.get(); + String xqueryStr; + try { + xqueryStr = new String(xquery, "UTF-8"); + } catch(UnsupportedEncodingException e) { + xqueryStr = new String(xquery); + } + String result = null; try { ! result = con.query(user, xqueryStr, howmany, start, parameters); return result; } catch (Exception e) { Index: RpcAPI.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc/RpcAPI.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** RpcAPI.java 8 Jun 2004 08:16:13 -0000 1.30 --- RpcAPI.java 5 Jul 2004 20:02:48 -0000 1.31 *************** *** 282,286 **** String query( User user, ! String xquery, int howmany, int start, --- 282,286 ---- String query( User user, ! byte[] xquery, int howmany, int start, |
From: Wolfgang M. M. <wol...@us...> - 2004-07-05 20:02:57
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25405/src/org/exist/client Modified Files: ClientFrame.java Log Message: Fixed concurrency issue in the dom.dbx node store: in some cases, a reading thread could interfere with a writing thread. As a result, some data pages got lost. Index: ClientFrame.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/client/ClientFrame.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ClientFrame.java 21 Jun 2004 15:27:33 -0000 1.20 --- ClientFrame.java 5 Jul 2004 20:02:48 -0000 1.21 *************** *** 841,846 **** setStatus("Copying " + res[i].toString() + " to " + destinationPath + "..."); if(res[i] instanceof InteractiveClient.CollectionName) ! //service.move(res[i].toString(), destinationPath, null); ! showErrorMessage("Copy is not yet implemented for collections", null); else service.copyResource(res[i].toString(), destinationPath, null); --- 841,845 ---- setStatus("Copying " + res[i].toString() + " to " + destinationPath + "..."); if(res[i] instanceof InteractiveClient.CollectionName) ! service.copy(res[i].toString(), destinationPath, null); else service.copyResource(res[i].toString(), destinationPath, null); |
From: Wolfgang M. M. <wol...@us...> - 2004-07-05 20:02:56
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage/store In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25405/src/org/exist/storage/store Modified Files: DOMFile.java NodeIterator.java Log Message: Fixed concurrency issue in the dom.dbx node store: in some cases, a reading thread could interfere with a writing thread. As a result, some data pages got lost. Index: DOMFile.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/store/DOMFile.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** DOMFile.java 30 Jun 2004 15:57:16 -0000 1.36 --- DOMFile.java 5 Jul 2004 20:02:47 -0000 1.37 *************** *** 27,32 **** --- 27,35 ---- import java.io.UnsupportedEncodingException; import java.util.ArrayList; + import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; + import java.util.Map; + import java.util.TreeMap; import org.dbxml.core.DBException; *************** *** 49,52 **** --- 52,56 ---- import org.exist.storage.cache.ClockCache; import org.exist.util.ByteConversion; + import org.exist.util.FastQSort; import org.exist.util.Lock; import org.exist.util.LockException; *************** *** 206,209 **** --- 210,214 ---- throws ReadOnlyException { final int valueLen = value.length; + final Object myOwner = owner; // always append data to the end of the file DOMPage page = getCurrentPage(); *************** *** 218,227 **** --- 223,238 ---- dataCache.add(page); } + // LOG.debug("created new page: " + newPage.getPageNum() + "; prev = " + page.getPageNum() + + // "; oldLen = " + page.len + "; valueLen = " + valueLen); page = newPage; setCurrentPage(newPage); + if(owner != myOwner) + LOG.error("Owner changed during transaction!!!!!!!!!!!!!!!!!"); } // save tuple identifier final DOMFilePageHeader ph = page.getPageHeader(); final short tid = ph.getNextTID(); + // LOG.debug("writing to " + page.getPageNum() + "; " + page.len + "; tid = " + tid + + // "; len = " + valueLen + "; dataLen = " + page.data.length); ByteConversion.shortToByte(tid, page.data, page.len); page.len += 2; *************** *** 392,397 **** // write the data short tid = rec.page.getPageHeader().getNextTID(); ! // LOG.debug("inserting " + new String(value) + " to " + rec.page.page.getPageInfo() + "; " + ! // tid); ByteConversion.shortToByte((short) tid, rec.page.data, rec.offset); rec.offset += 2; --- 403,407 ---- // write the data short tid = rec.page.getPageHeader().getNextTID(); ! // LOG.debug("inserting " + new String(value) + " to " + rec.page.page.getPageInfo() + "; " + tid); ByteConversion.shortToByte((short) tid, rec.page.data, rec.offset); rec.offset += 2; *************** *** 449,455 **** long backLink; short splitRecordCount = 0; ! // LOG.debug("splitting " + rec.page.getPageNum() + ": new: " ! // + nextSplitPage.getPageNum() + "; next: " + ! // rec.page.getPageHeader().getNextDataPage()); for (int pos = rec.offset; pos < oldDataLen; splitRecordCount++) { // read the current id --- 459,465 ---- long backLink; short splitRecordCount = 0; ! LOG.debug("splitting " + rec.page.getPageNum() + ": new: " ! + nextSplitPage.getPageNum() + "; next: " + ! rec.page.getPageHeader().getNextDataPage()); for (int pos = rec.offset; pos < oldDataLen; splitRecordCount++) { // read the current id *************** *** 627,632 **** } ! private void printPageContents(DOMPage page) { ! System.out.print("Page " + page.getPageNum() + ": "); short count = 0; short currentId, vlen; --- 637,643 ---- } ! public String debugPageContents(DOMPage page) { ! StringBuffer buf = new StringBuffer(); ! buf.append("Page " + page.getPageNum() + ": "); short count = 0; short currentId, vlen; *************** *** 634,638 **** for (int pos = 0; pos < dlen; count++) { currentId = ByteConversion.byteToShort(page.data, pos); ! System.out.print(currentId + " "); if (ItemId.isLink(currentId)) { pos += 10; --- 645,649 ---- for (int pos = 0; pos < dlen; count++) { currentId = ByteConversion.byteToShort(page.data, pos); ! buf.append(currentId + " "); if (ItemId.isLink(currentId)) { pos += 10; *************** *** 645,650 **** } } ! System.out.println(); ! LOG.debug("page " + page.getPageNum() + " has " + count + " records."); } --- 656,661 ---- } } ! buf.append("; records in page: " + count); ! return buf.toString(); } *************** *** 824,828 **** super.flush(); dataCache.flush(); ! pages.remove(owner); try { if (fileHeader.isDirty()) fileHeader.write(); --- 835,840 ---- super.flush(); dataCache.flush(); ! // pages.remove(owner); ! closeDocument(); try { if (fileHeader.isDirty()) fileHeader.write(); *************** *** 836,840 **** super.flush(); dataCache.flush(); ! pages.remove(owner); try { if (fileHeader.isDirty()) fileHeader.write(); --- 848,853 ---- super.flush(); dataCache.flush(); ! // pages.remove(owner); ! closeDocument(); try { if (fileHeader.isDirty()) fileHeader.write(); *************** *** 957,960 **** --- 970,975 ---- final DOMPage page = new DOMPage(); pages.put(owner, page.page.getPageNum()); + LOG.debug("new page created: " + page.page.getPageNum() + " by " + owner + + "; thread: " + Thread.currentThread().getName()); dataCache.add(page); return page; *************** *** 980,983 **** --- 995,1000 ---- public void closeDocument() { pages.remove(owner); + // LOG.debug("current doc closed by: " + owner + + // "; thread: " + Thread.currentThread().getName()); } *************** *** 1105,1108 **** --- 1122,1126 ---- rec.page.setDirty(true); ph.decRecordCount(); + // LOG.debug(debugPageContents(rec.page)); if (rec.page.len == 0) { // LOG.debug("removing page " + rec.page.getPageNum()); *************** *** 1168,1177 **** --- 1186,1205 ---- public void removeAll(long p) { + // StringBuffer debug = new StringBuffer(); + // debug.append("Removed pages: "); long pnum = StorageAddress.pageFromPointer(p); while(-1 < pnum) { + // debug.append(' ').append(pnum); DOMPage page = getCurrentPage(pnum); pnum = page.getPageHeader().getNextDataPage(); dataCache.remove(page); try { + DOMFilePageHeader ph = page.getPageHeader(); + ph.setNextDataPage(-1); + ph.setPrevDataPage(-1); + ph.setDataLength(0); + ph.setNextTID((short) -1); + ph.setRecordCount((short) 0); + page.len = 0; unlinkPages(page.page); } catch (IOException e) { *************** *** 1179,1182 **** --- 1207,1224 ---- } } + // LOG.debug(debug.toString()); + } + + public String debugPages(DocumentImpl doc) { + StringBuffer buf = new StringBuffer(); + buf.append("Pages used by ").append(doc.getFileName()); + buf.append(':'); + long pnum = StorageAddress.pageFromPointer(((NodeImpl)doc.getFirstChild()).getInternalAddress()); + while(-1 < pnum) { + DOMPage page = getCurrentPage(pnum); + buf.append(' ').append(pnum); + pnum = page.getPageHeader().getNextDataPage(); + } + return buf.toString(); } *************** *** 1188,1194 **** */ private final void setCurrentPage(DOMPage page) { ! final long pnum = pages.get(owner); if (pnum == page.page.getPageNum()) return; ! //pages.remove(owner); pages.put(owner, page.page.getPageNum()); } --- 1230,1238 ---- */ private final void setCurrentPage(DOMPage page) { ! long pnum = pages.get(owner); if (pnum == page.page.getPageNum()) return; ! // pages.remove(owner); ! // LOG.debug("current page set: " + page.page.getPageNum() + " by " + owner.hashCode() + ! // "; thread: " + Thread.currentThread().getName()); pages.put(owner, page.page.getPageNum()); } *************** *** 1210,1220 **** */ public final void setOwnerObject(Object obj) { owner = obj; } - public final void releaseOwner(Object obj) { - //pages.remove(obj); - } - /** * Update the key/value pair. --- 1254,1262 ---- */ public final void setOwnerObject(Object obj) { + // if(owner != obj && obj != null) + // LOG.debug("owner set -> " + obj.hashCode()); owner = obj; } /** * Update the key/value pair. Index: NodeIterator.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/store/NodeIterator.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** NodeIterator.java 16 Jun 2004 09:23:50 -0000 1.11 --- NodeIterator.java 5 Jul 2004 20:02:47 -0000 1.12 *************** *** 121,130 **** if (nextPage < 0) { LOG.debug("bad link to next " + p.page.getPageInfo() + "; previous: " + ! ph.getPrevDataPage()); return null; } - // LOG.debug(page + " -> " + nextPage); page = nextPage; p = db.getCurrentPage(nextPage); db.addToBuffer(p); offset = 0; --- 121,130 ---- if (nextPage < 0) { LOG.debug("bad link to next " + p.page.getPageInfo() + "; previous: " + ! ph.getPrevDataPage() + "; offset = " + offset + "; lastTID = " + lastTID); return null; } page = nextPage; p = db.getCurrentPage(nextPage); + // LOG.debug(" -> " + nextPage + "; len = " + p.len + "; " + p.page.getPageInfo()); db.addToBuffer(p); offset = 0; *************** *** 169,172 **** --- 169,173 ---- p.getPageHeader().getPrevDataPage() + "; offset = " + (offset - l) + "; len = " + p.getPageHeader().getDataLength()); + LOG.debug(db.debugPageContents(p)); return null; } |
From: Wolfgang M. M. <wol...@us...> - 2004-07-05 20:02:56
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25405/src/org/exist/storage Modified Files: BrokerPool.java DBBroker.java NativeBroker.java Log Message: Fixed concurrency issue in the dom.dbx node store: in some cases, a reading thread could interfere with a writing thread. As a result, some data pages got lost. Index: NativeBroker.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/NativeBroker.java,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** NativeBroker.java 2 Jul 2004 18:24:53 -0000 1.86 --- NativeBroker.java 5 Jul 2004 20:02:47 -0000 1.87 *************** *** 73,76 **** --- 73,77 ---- import org.exist.storage.store.DOMTransaction; import org.exist.storage.store.NodeIterator; + import org.exist.storage.store.StorageAddress; import org.exist.util.ByteArrayPool; import org.exist.util.ByteConversion; *************** *** 472,476 **** public Iterator getNodeIterator(NodeProxy proxy) { ! domDb.setOwnerObject(this); try { return new NodeIterator(this, domDb, proxy, false); --- 473,477 ---- public Iterator getNodeIterator(NodeProxy proxy) { ! // domDb.setOwnerObject(this); try { return new NodeIterator(this, domDb, proxy, false); *************** *** 938,960 **** lock.release(); } ! // now reindex the nodes ! Iterator iterator; ! if (node == null) { ! NodeList nodes = doc.getChildNodes(); ! NodeImpl n; ! for (int i = 0; i < nodes.getLength(); i++) { ! n = (NodeImpl) nodes.item(i); iterator = getNodeIterator( ! new NodeProxy(doc, n.getGID(), n.getInternalAddress())); iterator.next(); ! scanNodes(iterator, n, new NodePath(), false); } ! } else { ! iterator = ! getNodeIterator( ! new NodeProxy(doc, node.getGID(), node.getInternalAddress())); ! iterator.next(); ! scanNodes(iterator, node, node.getPath(), false); } elementIndex.reindex(oldDoc, node); --- 939,966 ---- lock.release(); } ! try { ! // now reindex the nodes ! Iterator iterator; ! if (node == null) { ! NodeList nodes = doc.getChildNodes(); ! NodeImpl n; ! for (int i = 0; i < nodes.getLength(); i++) { ! n = (NodeImpl) nodes.item(i); ! iterator = ! getNodeIterator( ! new NodeProxy(doc, n.getGID(), n.getInternalAddress())); ! iterator.next(); ! scanNodes(iterator, n, new NodePath(), false); ! } ! } else { iterator = getNodeIterator( ! new NodeProxy(doc, node.getGID(), node.getInternalAddress())); iterator.next(); ! scanNodes(iterator, node, node.getPath(), false); } ! } catch(Exception e) { ! LOG.error("Error occured while reindexing document: " + e.getMessage(), e); ! LOG.debug(domDb.debugPages(doc)); } elementIndex.reindex(oldDoc, node); *************** *** 1141,1144 **** --- 1147,1151 ---- newName = doc.getFileName().substring(p + 1); } + Lock lock = null; try { *************** *** 1150,1153 **** --- 1157,1162 ---- DocumentImpl oldDoc = destination.getDocument(this, newName); if(oldDoc != null) { + if(doc.getDocId() == oldDoc.getDocId()) + throw new PermissionDeniedException("Cannot copy resource to itself"); if(!destination.getPermissions().validate(user, Permission.UPDATE)) throw new PermissionDeniedException("Resource with same name exists in target " + *************** *** 1157,1165 **** "collection and update is denied"); collection.removeDocument(this, oldDoc.getFileName()); ! } else ! if(!destination.getPermissions().validate(user, Permission.WRITE)) throw new PermissionDeniedException("Insufficient privileges on target collection " + destination.getName()); ! DocumentImpl newDoc = new DocumentImpl(this, newName, destination); newDoc.copyOf(doc); --- 1166,1174 ---- "collection and update is denied"); collection.removeDocument(this, oldDoc.getFileName()); ! } else { ! if(!destination.getPermissions().validate(user, Permission.WRITE)) throw new PermissionDeniedException("Insufficient privileges on target collection " + destination.getName()); ! } DocumentImpl newDoc = new DocumentImpl(this, newName, destination); newDoc.copyOf(doc); *************** *** 1199,1204 **** final long start = System.currentTimeMillis(); try { final NodeImpl firstChild = (NodeImpl)doc.getFirstChild(); ! // dropping old structure index elementIndex.dropIndex(doc); --- 1208,1215 ---- final long start = System.currentTimeMillis(); try { + // checkTree(doc); final NodeImpl firstChild = (NodeImpl)doc.getFirstChild(); ! // LOG.debug(domDb.debugPages(doc)); ! // dropping old structure index elementIndex.dropIndex(doc); *************** *** 1211,1219 **** try { domDb.remove(idx, null); - domDb.flush(); } catch (BTreeException e) { LOG.warn("start() - " + "error while removing doc", e); - } catch (DBException e) { - LOG.warn("start() - " + "error while removing doc", e); } catch (IOException e) { LOG.warn("start() - " + "error while removing doc", e); --- 1222,1227 ---- *************** *** 1248,1252 **** new DOMTransaction(this, domDb) { public Object start() { - domDb.remove(doc.getAddress()); domDb.removeAll(firstChild.getInternalAddress()); return null; --- 1256,1259 ---- *************** *** 1255,1263 **** --- 1262,1274 ---- .run(); + // LOG.debug(domDb.debugPages(tempDoc)); + doc.copyChildren(tempDoc); doc.setSplitCount(0); doc.setAddress(-1); doc.setPageCount(tempDoc.getPageCount()); + // checkTree(doc); storeDocument(doc); + LOG.debug("new doc address = " + StorageAddress.toString(doc.getAddress())); closeDocument(); *************** *** 1310,1313 **** --- 1321,1365 ---- } + public void checkTree(DocumentImpl doc) { + LOG.debug("Checking DOM tree for document " + doc.getFileName()); + NodeList nodes = doc.getChildNodes(); + NodeImpl n; + for (int i = 0; i < nodes.getLength(); i++) { + n = (NodeImpl) nodes.item(i); + Iterator iterator = + getNodeIterator( + new NodeProxy(doc, n.getGID(), n.getInternalAddress())); + iterator.next(); + checkTree(iterator, n); + } + } + + private void checkTree(Iterator iterator, NodeImpl node) { + if (node.hasChildNodes()) { + final long firstChildId = XMLUtil.getFirstChildId((DocumentImpl)node.getOwnerDocument(), + node.getGID()); + if (firstChildId < 0) { + LOG.fatal( + "no child found: expected = " + + node.getChildCount() + + "; node = " + + node.getNodeName() + + "; gid = " + + node.getGID()); + throw new IllegalStateException("wrong node id"); + } + final long lastChildId = firstChildId + node.getChildCount(); + NodeImpl child; + for (long gid = firstChildId; gid < lastChildId; gid++) { + child = (NodeImpl) iterator.next(); + if(child == null) + LOG.debug("child " + gid + " not found for node: " + node.getNodeName() + + "; last = " + lastChildId + "; children = " + node.getChildCount()); + child.setGID(gid); + checkTree(iterator, child); + } + } + } + public String getNodeValue(final NodeProxy proxy) { return (String) new DOMTransaction(this, domDb, Lock.READ_LOCK) { *************** *** 1921,1924 **** --- 1973,1978 ---- DocumentImpl oldDoc = destination.getDocument(this, newName); if(oldDoc != null) { + if(doc.getDocId() == oldDoc.getDocId()) + throw new PermissionDeniedException("Cannot move resource to itself"); if(!destination.getPermissions().validate(user, Permission.UPDATE)) throw new PermissionDeniedException("Resource with same name exists in target " + *************** *** 1932,1946 **** throw new PermissionDeniedException("Insufficient privileges on target collection " + destination.getName()); collection.unlinkDocument(doc); ! elementIndex.dropIndex(doc); ! textEngine.dropIndex(doc); ! saveCollection(collection); ! doc.setFileName(newName); destination.addDocument(this, doc); doc.setCollection(destination); ! // reindexing ! reindex(doc); saveCollection(destination); } catch (TriggerException e) { --- 1986,2005 ---- throw new PermissionDeniedException("Insufficient privileges on target collection " + destination.getName()); + + boolean renameOnly = collection.getId() == destination.getId(); collection.unlinkDocument(doc); ! if(!renameOnly) { ! elementIndex.dropIndex(doc); ! textEngine.dropIndex(doc); ! saveCollection(collection); ! } doc.setFileName(newName); destination.addDocument(this, doc); doc.setCollection(destination); ! if(!renameOnly) { ! // reindexing ! reindex(doc); ! } saveCollection(destination); } catch (TriggerException e) { *************** *** 1953,1960 **** --- 2012,2065 ---- } + public void copyCollection(Collection collection, Collection destination, String newName) + throws PermissionDeniedException, LockException { + if (readOnly) + throw new PermissionDeniedException(DATABASE_IS_READ_ONLY); + if(!collection.getPermissions().validate(user, Permission.READ)) + throw new PermissionDeniedException("Read permission denied on collection " + + collection.getName()); + if(collection.getId() == destination.getId()) + throw new PermissionDeniedException("Cannot move collection to itself"); + if(!destination.getPermissions().validate(user, Permission.WRITE)) + throw new PermissionDeniedException("Insufficient privileges on target collection " + + destination.getName()); + if(newName == null) { + int p = collection.getName().lastIndexOf('/'); + newName = collection.getName().substring(p + 1); + } + if(newName.indexOf('/') > -1) + throw new PermissionDeniedException("New collection name is illegal (may not contain a '/')"); + Lock lock = null; + try { + lock = collectionsDb.getLock(); + lock.acquire(Lock.WRITE_LOCK); + newName = destination.getName() + '/' + newName; + // check if another collection with the same name exists at the destination + Collection old = getCollection(newName); + if(old != null) + removeCollection(old.getName()); + Collection destCollection = getOrCreateCollection(newName); + for(Iterator i = collection.iterator(this); i.hasNext(); ) { + DocumentImpl child = (DocumentImpl) i.next(); + + DocumentImpl newDoc = new DocumentImpl(this, child.getFileName(), destCollection); + newDoc.copyOf(child); + copyResource(child, newDoc); + flush(); + destCollection.addDocument(this, child); + } + saveCollection(destCollection); + saveCollection(destination); + } finally { + lock.release(); + } + } + public void moveCollection(Collection collection, Collection destination, String newName) throws PermissionDeniedException, LockException { if (readOnly) throw new PermissionDeniedException(DATABASE_IS_READ_ONLY); + if(collection.getId() == destination.getId()) + throw new PermissionDeniedException("Cannot move collection to itself"); if(collection.getName().equals(ROOT_COLLECTION)) throw new PermissionDeniedException("Cannot move the db root collection"); Index: DBBroker.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/DBBroker.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** DBBroker.java 27 Jun 2004 21:10:07 -0000 1.36 --- DBBroker.java 5 Jul 2004 20:02:46 -0000 1.37 *************** *** 94,97 **** --- 94,99 ---- protected int docFragmentationLimit = 25; + protected String id; + /** * Save the global symbol table. The global symbol table stores *************** *** 175,179 **** xqueryService = new XQuery(this); } ! /** * Set the user that is currently using this DBBroker object. --- 177,181 ---- xqueryService = new XQuery(this); } ! /** * Set the user that is currently using this DBBroker object. *************** *** 486,489 **** --- 488,501 ---- /** + * Copy a collection to the destination collection and rename it. + * + * @param doc the resource to move + * @param destination the destination collection + * @param new Name the new name the resource should have in the destination collection + */ + public abstract void copyCollection(Collection collection, Collection destination, String newName) + throws PermissionDeniedException, LockException; + + /** * Copy a resource to the destination collection and rename it. * *************** *** 499,502 **** --- 511,523 ---- public abstract void defrag(DocumentImpl doc); + /** + * Perform a consistency check on the specified document. + * + * This checks if the DOM tree is consistent. + * + * @param doc + */ + public abstract void checkTree(DocumentImpl doc); + public void sync() { /* *************** *** 585,587 **** --- 606,620 ---- public abstract int getPageSize(); + + public void setId(String id) { + this.id = id; + } + + public String getId() { + return id; + } + + public String toString() { + return id; + } } Index: BrokerPool.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/BrokerPool.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** BrokerPool.java 4 Jun 2004 09:44:34 -0000 1.23 --- BrokerPool.java 5 Jul 2004 20:02:46 -0000 1.24 *************** *** 233,236 **** --- 233,237 ---- active.add(broker); brokers++; + broker.setId(broker.getClass().getName() + '_' + brokers); return broker; } |
From: Wolfgang M. M. <wol...@us...> - 2004-07-05 20:02:56
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmldb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25405/src/org/exist/xmldb Modified Files: LocalCollectionManagementService.java CollectionManagementServiceImpl.java Log Message: Fixed concurrency issue in the dom.dbx node store: in some cases, a reading thread could interfere with a writing thread. As a result, some data pages got lost. Index: LocalCollectionManagementService.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/LocalCollectionManagementService.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** LocalCollectionManagementService.java 2 Jul 2004 16:53:53 -0000 1.12 --- LocalCollectionManagementService.java 5 Jul 2004 20:02:47 -0000 1.13 *************** *** 224,227 **** --- 224,261 ---- } + /* (non-Javadoc) + * @see org.exist.xmldb.CollectionManagementServiceImpl#copy(java.lang.String, java.lang.String, java.lang.String) + */ + public void copy(String collectionPath, String destinationPath, String newName) + throws XMLDBException { + if(!collectionPath.startsWith("/db")) + collectionPath = parent.getPath() + '/' + collectionPath; + if(!destinationPath.startsWith("/db")) + destinationPath = parent.getPath() + '/' + destinationPath; + DBBroker broker = null; + try { + broker = brokerPool.get(user); + org.exist.collections.Collection collection = broker.getCollection(collectionPath); + if(collection == null) + throw new XMLDBException(ErrorCodes.NO_SUCH_COLLECTION, "Collection " + collectionPath + " not found"); + org.exist.collections.Collection destination = broker.getCollection(destinationPath); + if(destination == null) + throw new XMLDBException(ErrorCodes.NO_SUCH_COLLECTION, "Collection " + destinationPath + " not found"); + broker.copyCollection(collection, destination, newName); + } catch ( EXistException e ) { + e.printStackTrace(); + throw new XMLDBException( ErrorCodes.VENDOR_ERROR, + "failed to move collection " + collectionPath, e ); + } catch ( PermissionDeniedException e ) { + throw new XMLDBException( ErrorCodes.PERMISSION_DENIED, + e.getMessage(), e ); + } catch (LockException e) { + throw new XMLDBException( ErrorCodes.PERMISSION_DENIED, + e.getMessage(), e ); + } finally { + brokerPool.release( broker ); + } + } + public void setCollection( Collection parent ) throws XMLDBException { this.parent = (LocalCollection) parent; Index: CollectionManagementServiceImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/CollectionManagementServiceImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CollectionManagementServiceImpl.java 21 Jun 2004 15:27:36 -0000 1.6 --- CollectionManagementServiceImpl.java 5 Jul 2004 20:02:48 -0000 1.7 *************** *** 45,47 **** --- 45,50 ---- public void copyResource(String resourcePath, String destinationPath, String newName) throws XMLDBException; + + public void copy(String collection, String destination, String newName) + throws XMLDBException; } |
From: Jean-Marc V. <jm...@us...> - 2004-07-05 13:12:11
|
Update of /cvsroot/exist/eXist-1.0/webapp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14099 Modified Files: xquery.xml Log Message: mistake corrected in XML:DB URL Index: xquery.xml =================================================================== RCS file: /cvsroot/exist/eXist-1.0/webapp/xquery.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** xquery.xml 16 Feb 2004 08:23:55 -0000 1.5 --- xquery.xml 5 Jul 2004 13:12:03 -0000 1.6 *************** *** 360,364 **** xdb:register-database("org.exist.xmldb.DatabaseImpl", true()), ! let $root := xdb:collection("xdb:exist:///db", "admin", ""), $out := xdb:create-collection($root, "output") for $rec in /rdf:RDF/* return --- 360,364 ---- xdb:register-database("org.exist.xmldb.DatabaseImpl", true()), ! let $root := xdb:collection("xmldb:exist:///db", "admin", ""), $out := xdb:create-collection($root, "output") for $rec in /rdf:RDF/* return |
From: Wolfgang M. M. <wol...@us...> - 2004-07-02 20:15:59
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmldb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22811/src/org/exist/xmldb Modified Files: DatabaseImpl.java Log Message: Index: DatabaseImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/DatabaseImpl.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** DatabaseImpl.java 2 Jul 2004 16:53:53 -0000 1.17 --- DatabaseImpl.java 2 Jul 2004 20:15:49 -0000 1.18 *************** *** 182,186 **** ? current : null; } catch ( XMLDBException e ) { - e.printStackTrace(); switch ( e.errorCode ) { case ErrorCodes.NO_SUCH_RESOURCE: --- 182,185 ---- |
From: Wolfgang M. M. <wol...@us...> - 2004-07-02 20:15:58
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22811/src/org/exist/xquery Modified Files: DynamicAttributeConstructor.java Log Message: Index: DynamicAttributeConstructor.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/DynamicAttributeConstructor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DynamicAttributeConstructor.java 2 Jul 2004 16:53:53 -0000 1.2 --- DynamicAttributeConstructor.java 2 Jul 2004 20:15:34 -0000 1.3 *************** *** 64,68 **** public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException { - System.out.println(pprint()); MemTreeBuilder builder = context.getDocumentBuilder(); context.proceed(this, builder); --- 64,67 ---- |
From: Wolfgang M. M. <wol...@us...> - 2004-07-02 18:25:07
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2122/src/org/exist/storage Modified Files: NativeTextEngine.java NativeBroker.java Log Message: Increased default cache size settings for dom.dbx. Index: NativeBroker.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/NativeBroker.java,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** NativeBroker.java 2 Jul 2004 16:53:57 -0000 1.85 --- NativeBroker.java 2 Jul 2004 18:24:53 -0000 1.86 *************** *** 168,172 **** < 0) { indexBuffers = buffers * 4; ! dataBuffers = buffers * 11; } else dataBuffers = indexBuffers >> 2; --- 168,172 ---- < 0) { indexBuffers = buffers * 4; ! dataBuffers = buffers * 10; } else dataBuffers = indexBuffers >> 2; *************** *** 195,199 **** } else { indexBuffers = buffers * 4; ! dataBuffers = buffers; } LOG.debug("page buffer size = " + indexBuffers + "; " + dataBuffers); --- 195,199 ---- } else { indexBuffers = buffers * 4; ! dataBuffers = buffers * 8; } LOG.debug("page buffer size = " + indexBuffers + "; " + dataBuffers); *************** *** 218,223 **** config.getInteger("db-connection.collections.buffers")) < 0) { ! indexBuffers = buffers * 8; ! dataBuffers = buffers * 8; } else dataBuffers = indexBuffers; --- 218,223 ---- config.getInteger("db-connection.collections.buffers")) < 0) { ! indexBuffers = buffers * 6; ! dataBuffers = buffers * 6; } else dataBuffers = indexBuffers; Index: NativeTextEngine.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/NativeTextEngine.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** NativeTextEngine.java 21 Jun 2004 15:27:33 -0000 1.58 --- NativeTextEngine.java 2 Jul 2004 18:24:45 -0000 1.59 *************** *** 122,126 **** if ((indexBuffers = config.getInteger("db-connection.words.buffers")) < 0) { indexBuffers = buffers * 14; ! dataBuffers = indexBuffers; } else dataBuffers = indexBuffers; --- 122,126 ---- if ((indexBuffers = config.getInteger("db-connection.words.buffers")) < 0) { indexBuffers = buffers * 14; ! dataBuffers = buffers * 12; } else dataBuffers = indexBuffers; |
From: Wolfgang M. M. <wol...@us...> - 2004-07-02 18:05:53
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31145/src/org/exist/client Modified Files: InteractiveClient.java Log Message: Index: InteractiveClient.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/client/InteractiveClient.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** InteractiveClient.java 2 Jul 2004 16:53:56 -0000 1.32 --- InteractiveClient.java 2 Jul 2004 18:05:44 -0000 1.33 *************** *** 421,425 **** Resource res; for (int j = 0; j < childResources.length; i++, j++) { - System.out.println("Loading " + childResources[j]); res = current.getResource(childResources[j]); perm = mgtService.getPermissions(res); --- 421,424 ---- |
From: Wolfgang M. M. <wol...@us...> - 2004-07-02 18:00:52
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30134/src/org/exist/xmlrpc Modified Files: RpcConnection.java Log Message: Nested query feature had been broken. Index: RpcConnection.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc/RpcConnection.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** RpcConnection.java 2 Jul 2004 16:53:56 -0000 1.62 --- RpcConnection.java 2 Jul 2004 18:00:35 -0000 1.63 *************** *** 252,256 **** try { long start = System.currentTimeMillis(); ! Sequence result = xquery.execute(compiled, null); LOG.info("query took " + (System.currentTimeMillis() - start) + "ms."); return result; --- 252,256 ---- try { long start = System.currentTimeMillis(); ! Sequence result = xquery.execute(compiled, contextSet); LOG.info("query took " + (System.currentTimeMillis() - start) + "ms."); return result; |
From: Wolfgang M. M. <wol...@us...> - 2004-07-02 16:54:34
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15785/src/org/exist/xquery/functions Modified Files: FunDoc.java ExtDocument.java ExtCollection.java Log Message: Fixed resource read/write permissions check. Index: ExtDocument.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/ExtDocument.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ExtDocument.java 23 Jun 2004 12:46:35 -0000 1.5 --- ExtDocument.java 2 Jul 2004 16:53:55 -0000 1.6 *************** *** 32,35 **** --- 32,36 ---- import org.exist.dom.NodeProxy; import org.exist.dom.QName; + import org.exist.security.Permission; import org.exist.security.PermissionDeniedException; import org.exist.util.LockException; *************** *** 125,128 **** --- 126,131 ---- DocumentImpl doc = (DocumentImpl) context.getBroker().getDocument(next); if(doc != null) { + if(!doc.getPermissions().validate(context.getUser(), Permission.READ)) + throw new XPathException("Insufficient privileges to read resource " + next); docs.add(doc); } Index: FunDoc.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/FunDoc.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FunDoc.java 23 Jun 2004 12:46:35 -0000 1.5 --- FunDoc.java 2 Jul 2004 16:53:55 -0000 1.6 *************** *** 26,29 **** --- 26,30 ---- import org.exist.dom.NodeProxy; import org.exist.dom.QName; + import org.exist.security.Permission; import org.exist.security.PermissionDeniedException; import org.exist.util.Lock; *************** *** 111,114 **** --- 112,117 ---- if(doc == null) return Sequence.EMPTY_SEQUENCE; + if(!doc.getPermissions().validate(context.getUser(), Permission.READ)) + throw new XPathException(getASTNode(), "Insufficient privileges to read resource " + path); // wait for currently pending updates dlock = doc.getUpdateLock(); Index: ExtCollection.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/ExtCollection.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ExtCollection.java 23 Jun 2004 12:46:35 -0000 1.5 --- ExtCollection.java 2 Jul 2004 16:53:55 -0000 1.6 *************** *** 27,30 **** --- 27,31 ---- import java.util.List; + import org.exist.collections.Collection; import org.exist.dom.DocumentImpl; import org.exist.dom.DocumentSet; *************** *** 33,37 **** import org.exist.dom.NodeSet; import org.exist.dom.QName; - import org.exist.security.PermissionDeniedException; import org.exist.util.Lock; import org.exist.util.LockException; --- 34,37 ---- *************** *** 101,110 **** for (int i = 0; i < args.size(); i++) { String next = (String)args.get(i); ! try { ! context.getBroker().getDocumentsByCollection(next, docs, includeSubCollections); ! } catch (PermissionDeniedException e) { ! throw new XPathException( ! "Permission denied: unable to load document " + next); ! } } NodeSet result = new ExtArrayNodeSet(docs.getLength(), 1); --- 101,106 ---- for (int i = 0; i < args.size(); i++) { String next = (String)args.get(i); ! Collection coll = context.getBroker().getCollection(next); ! coll.allDocs(context.getBroker(), docs, includeSubCollections, true); } NodeSet result = new ExtArrayNodeSet(docs.getLength(), 1); |
From: Wolfgang M. M. <wol...@us...> - 2004-07-02 16:54:34
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/http/webdav/methods In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15785/src/org/exist/http/webdav/methods Modified Files: Get.java Log Message: Fixed resource read/write permissions check. Index: Get.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/http/webdav/methods/Get.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Get.java 23 Apr 2004 13:14:02 -0000 1.1 --- Get.java 2 Jul 2004 16:53:55 -0000 1.2 *************** *** 36,39 **** --- 36,40 ---- import org.exist.http.webdav.WebDAV; import org.exist.http.webdav.WebDAVMethod; + import org.exist.security.Permission; import org.exist.security.User; import org.exist.storage.BrokerPool; *************** *** 64,67 **** --- 65,72 ---- return; } + if(!resource.getPermissions().validate(user, Permission.READ)) { + response.sendError(HttpServletResponse.SC_FORBIDDEN, "Not allowed to read resource"); + return; + } String contentType; if(resource.getResourceType() == DocumentImpl.XML_FILE) |
From: Wolfgang M. M. <wol...@us...> - 2004-07-02 16:54:34
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage/serializers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15785/src/org/exist/storage/serializers Modified Files: XIncludeFilter.java Serializer.java Log Message: Fixed resource read/write permissions check. Index: XIncludeFilter.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/serializers/XIncludeFilter.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** XIncludeFilter.java 8 Mar 2004 11:21:21 -0000 1.17 --- XIncludeFilter.java 2 Jul 2004 16:53:54 -0000 1.18 *************** *** 12,15 **** --- 12,16 ---- import org.exist.dom.NodeSet; import org.exist.dom.XMLUtil; + import org.exist.security.Permission; import org.exist.security.PermissionDeniedException; import org.exist.xquery.PathExpr; *************** *** 177,180 **** --- 178,183 ---- try { doc = (DocumentImpl) serializer.broker.getDocument(docName); + if(!doc.getPermissions().validate(serializer.broker.getUser(), Permission.READ)) + throw new PermissionDeniedException("Permission denied to read xincluded resource"); } catch (PermissionDeniedException e) { LOG.warn("permission denied", e); Index: Serializer.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/serializers/Serializer.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Serializer.java 10 May 2004 11:22:43 -0000 1.24 --- Serializer.java 2 Jul 2004 16:53:54 -0000 1.25 *************** *** 52,55 **** --- 52,56 ---- import org.exist.dom.XMLUtil; import org.exist.memtree.Receiver; + import org.exist.security.Permission; import org.exist.security.PermissionDeniedException; import org.exist.security.User; *************** *** 313,317 **** else LOG.debug("serializing " + doc.getFileName()); ! serializeToSAX(doc, true); } catch (PermissionDeniedException e) { --- 314,319 ---- else LOG.debug("serializing " + doc.getFileName()); ! if(!doc.getPermissions().validate(broker.getUser(), Permission.READ)) ! throw new PermissionDeniedException("Not allowed to read resource"); serializeToSAX(doc, true); } catch (PermissionDeniedException e) { *************** *** 709,712 **** --- 711,719 ---- return; } + if(!xsl.getPermissions().validate(broker.getUser(), Permission.READ)) { + LOG.debug("Permission denied to read stylesheet doc."); + return; + } + if (xsl.getCollection() != null) { factory.setURIResolver( |
From: Wolfgang M. M. <wol...@us...> - 2004-07-02 16:54:33
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/collections/triggers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15785/src/org/exist/collections/triggers Modified Files: Dumper.java Log Message: Fixed resource read/write permissions check. Index: Dumper.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/collections/triggers/Dumper.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Dumper.java 1 Apr 2004 14:12:45 -0000 1.3 --- Dumper.java 2 Jul 2004 16:53:54 -0000 1.4 *************** *** 64,68 **** System.out.println("collection contents:"); DocumentSet docs = new DocumentSet(); ! collection.getDocuments(broker, docs); for(int i = 0; i < docs.getLength(); i++) System.out.println("\t" + ((DocumentImpl)docs.item(i)).getFileName()); --- 64,68 ---- System.out.println("collection contents:"); DocumentSet docs = new DocumentSet(); ! collection.getDocuments(broker, docs, true); for(int i = 0; i < docs.getLength(); i++) System.out.println("\t" + ((DocumentImpl)docs.item(i)).getFileName()); |
From: Wolfgang M. M. <wol...@us...> - 2004-07-02 16:54:33
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15785/src/org/exist/collections Modified Files: Collection.java Log Message: Fixed resource read/write permissions check. Index: Collection.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/collections/Collection.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Collection.java 21 Jun 2004 09:36:09 -0000 1.32 --- Collection.java 2 Jul 2004 16:53:53 -0000 1.33 *************** *** 267,280 **** */ public DocumentSet allDocs(DBBroker broker, DocumentSet docs, ! boolean recursive) { if (permissions.validate(broker.getUser(), Permission.READ)) { ! getDocuments(broker, docs); if (recursive) ! allDocs(broker, docs); } return docs; } ! private DocumentSet allDocs(DBBroker broker, DocumentSet docs) { try { lock.acquire(Lock.READ_LOCK); --- 267,280 ---- */ public DocumentSet allDocs(DBBroker broker, DocumentSet docs, ! boolean recursive, boolean checkPermissions) { if (permissions.validate(broker.getUser(), Permission.READ)) { ! getDocuments(broker, docs, checkPermissions); if (recursive) ! allDocs(broker, docs, checkPermissions); } return docs; } ! private DocumentSet allDocs(DBBroker broker, DocumentSet docs, boolean checkPermissions) { try { lock.acquire(Lock.READ_LOCK); *************** *** 287,294 **** if(child == null) { LOG.warn("child collection " + childName + " not found. Skipping ..."); } else if (child.permissions.validate(broker.getUser(), Permission.READ)) { ! child.getDocuments(broker, docs); if (child.getChildCollectionCount() > 0) ! child.allDocs(broker, docs); } } --- 287,295 ---- if(child == null) { LOG.warn("child collection " + childName + " not found. Skipping ..."); + // we always check if we have permissions to read the child collection } else if (child.permissions.validate(broker.getUser(), Permission.READ)) { ! child.getDocuments(broker, docs, checkPermissions); if (child.getChildCollectionCount() > 0) ! child.allDocs(broker, docs, checkPermissions); } } *************** *** 306,310 **** * @param docs */ ! public DocumentSet getDocuments(DBBroker broker, DocumentSet docs) { try { lock.acquire(Lock.READ_LOCK); --- 307,311 ---- * @param docs */ ! public DocumentSet getDocuments(DBBroker broker, DocumentSet docs, boolean checkPermissions) { try { lock.acquire(Lock.READ_LOCK); *************** *** 314,318 **** } docs.addCollection(this); ! docs.addAll(broker, documents.values()); } catch (LockException e) { LOG.warn(e.getMessage(), e); --- 315,319 ---- } docs.addCollection(this); ! docs.addAll(broker, documents.values(), checkPermissions); } catch (LockException e) { LOG.warn(e.getMessage(), e); *************** *** 538,542 **** */ public Iterator iterator(DBBroker broker) { ! return getDocuments(broker, new DocumentSet()).iterator(); } --- 539,543 ---- */ public Iterator iterator(DBBroker broker) { ! return getDocuments(broker, new DocumentSet(), false).iterator(); } *************** *** 682,685 **** --- 683,691 ---- throw new PermissionDeniedException("Document " + doc.getFileName() + " is locked for write"); + if (!getPermissions().validate(broker.getUser(), Permission.WRITE)) + throw new PermissionDeniedException( + "write access to collection denied; user=" + broker.getUser().getName()); + if (!doc.getPermissions().validate(broker.getUser(), Permission.WRITE)) + throw new PermissionDeniedException("permission to remove document denied"); try { lock.acquire(Lock.WRITE_LOCK); |
From: Wolfgang M. M. <wol...@us...> - 2004-07-02 16:54:33
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmldb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15785/src/org/exist/xmldb Modified Files: LocalCollection.java LocalUserManagementService.java LocalCollectionManagementService.java LocalXMLResource.java DatabaseImpl.java LocalBinaryResource.java LocalXUpdateQueryService.java LocalXPathQueryService.java Log Message: Fixed resource read/write permissions check. Index: LocalCollectionManagementService.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/LocalCollectionManagementService.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** LocalCollectionManagementService.java 21 Jun 2004 15:27:36 -0000 1.11 --- LocalCollectionManagementService.java 2 Jul 2004 16:53:53 -0000 1.12 *************** *** 25,28 **** --- 25,29 ---- import org.exist.EXistException; import org.exist.dom.DocumentImpl; + import org.exist.security.Permission; import org.exist.security.PermissionDeniedException; import org.exist.security.User; Index: LocalBinaryResource.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/LocalBinaryResource.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LocalBinaryResource.java 29 Jan 2004 15:06:43 -0000 1.2 --- LocalBinaryResource.java 2 Jul 2004 16:53:53 -0000 1.3 *************** *** 32,40 **** import org.exist.EXistException; import org.exist.dom.BinaryDocument; import org.exist.security.Permission; - import org.exist.security.PermissionDeniedException; import org.exist.security.User; import org.exist.storage.BrokerPool; import org.exist.storage.DBBroker; import org.xmldb.api.base.Collection; import org.xmldb.api.base.ErrorCodes; --- 32,41 ---- import org.exist.EXistException; import org.exist.dom.BinaryDocument; + import org.exist.dom.DocumentImpl; import org.exist.security.Permission; import org.exist.security.User; import org.exist.storage.BrokerPool; import org.exist.storage.DBBroker; + import org.exist.util.LockException; import org.xmldb.api.base.Collection; import org.xmldb.api.base.ErrorCodes; *************** *** 51,55 **** protected LocalCollection parent; protected String docId; - protected BinaryDocument blob = null; protected byte[] rawData = null; --- 52,55 ---- *************** *** 66,74 **** this.docId = docId; } - - public LocalBinaryResource(User user, BrokerPool pool, LocalCollection collection, BinaryDocument blob) { - this(user, pool, collection, blob.getFileName()); - this.blob = blob; - } /* (non-Javadoc) --- 66,69 ---- *************** *** 78,85 **** return parent; } - - public BinaryDocument getBlob() { - return blob; - } /* (non-Javadoc) --- 73,76 ---- *************** *** 101,108 **** */ public Object getContent() throws XMLDBException { ! if(rawData == null && blob != null) { DBBroker broker = null; try { broker = pool.get(user); rawData = broker.getBinaryResourceData(blob); } catch(EXistException e) { --- 92,104 ---- */ public Object getContent() throws XMLDBException { ! if(rawData == null) { DBBroker broker = null; + BinaryDocument blob = null; try { broker = pool.get(user); + blob = getDocument(broker, true); + if(!blob.getPermissions().validate(user, Permission.READ)) + throw new XMLDBException(ErrorCodes.PERMISSION_DENIED, + "Permission denied to read resource"); rawData = broker.getBinaryResourceData(blob); } catch(EXistException e) { *************** *** 110,113 **** --- 106,110 ---- "error while loading binary resource " + getId(), e); } finally { + parent.getCollection().releaseDocument(blob); pool.release(broker); } *************** *** 157,162 **** try { broker = pool.get(user); ! if (blob == null) ! getDocument(broker); if (!blob.getPermissions().validate(user, Permission.READ)) throw new XMLDBException( --- 154,158 ---- try { broker = pool.get(user); ! BinaryDocument blob = getDocument(broker, false); if (!blob.getPermissions().validate(user, Permission.READ)) throw new XMLDBException( *************** *** 178,183 **** try { broker = pool.get(user); ! if (blob == null) ! getDocument(broker); if (!blob.getPermissions().validate(user, Permission.READ)) throw new XMLDBException( --- 174,178 ---- try { broker = pool.get(user); ! BinaryDocument blob = getDocument(broker, false); if (!blob.getPermissions().validate(user, Permission.READ)) throw new XMLDBException( *************** *** 195,214 **** * @see org.exist.xmldb.EXistResource#getPermissions() */ ! public Permission getPermissions() { ! return blob != null ? blob.getPermissions() : null; } ! protected void getDocument(DBBroker broker) throws XMLDBException { ! if (blob != null) ! return; ! try { ! String path = ! (parent.getPath().equals("/") ? '/' + docId : parent.getPath() + '/' + docId); ! blob = (BinaryDocument) broker.getDocument(path); ! if (blob == null) ! throw new XMLDBException(ErrorCodes.INVALID_RESOURCE); ! } catch (PermissionDeniedException e) { ! throw new XMLDBException(ErrorCodes.PERMISSION_DENIED, e); ! } } } --- 190,223 ---- * @see org.exist.xmldb.EXistResource#getPermissions() */ ! public Permission getPermissions() throws XMLDBException { ! DBBroker broker = null; ! try { ! broker = pool.get(user); ! DocumentImpl document = getDocument(broker, false); ! return document != null ? document.getPermissions() : null; ! } catch (EXistException e) { ! throw new XMLDBException(ErrorCodes.INVALID_RESOURCE, e.getMessage(), e); ! } finally { ! pool.release(broker); ! } } ! protected BinaryDocument getDocument(DBBroker broker, boolean lock) throws XMLDBException { ! DocumentImpl document = null; ! if(lock) ! try { ! document = parent.getCollection().getDocumentWithLock(broker, docId); ! } catch (LockException e) { ! throw new XMLDBException(ErrorCodes.PERMISSION_DENIED, ! "Failed to acquire lock on document " + docId); ! } ! else ! document = parent.getCollection().getDocument(broker, docId); ! if (document == null) ! throw new XMLDBException(ErrorCodes.INVALID_RESOURCE); ! if (document.getResourceType() != DocumentImpl.BINARY_FILE) ! throw new XMLDBException(ErrorCodes.WRONG_CONTENT_TYPE, "Document " + docId + ! " is not a binary resource"); ! return (BinaryDocument)document; } } Index: DatabaseImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/DatabaseImpl.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** DatabaseImpl.java 21 May 2004 08:32:14 -0000 1.16 --- DatabaseImpl.java 2 Jul 2004 16:53:53 -0000 1.17 *************** *** 182,185 **** --- 182,186 ---- ? current : null; } catch ( XMLDBException e ) { + e.printStackTrace(); switch ( e.errorCode ) { case ErrorCodes.NO_SUCH_RESOURCE: Index: LocalXUpdateQueryService.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/LocalXUpdateQueryService.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** LocalXUpdateQueryService.java 27 Jun 2004 21:10:09 -0000 1.15 --- LocalXUpdateQueryService.java 2 Jul 2004 16:53:53 -0000 1.16 *************** *** 61,65 **** broker = pool.get(user); if (resource == null) { ! docs = c.allDocs(broker, docs, true); } else { DocumentImpl doc = c.getDocument(broker, resource); --- 61,65 ---- broker = pool.get(user); if (resource == null) { ! docs = c.allDocs(broker, docs, true, true); } else { DocumentImpl doc = c.getDocument(broker, resource); Index: LocalUserManagementService.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/LocalUserManagementService.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** LocalUserManagementService.java 8 Jun 2004 08:16:08 -0000 1.16 --- LocalUserManagementService.java 2 Jul 2004 16:53:53 -0000 1.17 *************** *** 56,60 **** document = ((LocalXMLResource) resource).getDocument(broker, true); else ! document = ((LocalBinaryResource) resource).getBlob(); if (!(document.getPermissions().getOwner().equals(user.getName()) || manager.hasAdminPrivileges(user))) --- 56,60 ---- document = ((LocalXMLResource) resource).getDocument(broker, true); else ! document = ((LocalBinaryResource) resource).getDocument(broker, true); if (!(document.getPermissions().getOwner().equals(user.getName()) || manager.hasAdminPrivileges(user))) *************** *** 164,168 **** document = ((LocalXMLResource) resource).getDocument(broker, true); else ! document = ((LocalBinaryResource) resource).getBlob(); if (!document.getPermissions().getOwner().equals(user.getName()) && !manager.hasAdminPrivileges(user)) --- 164,168 ---- document = ((LocalXMLResource) resource).getDocument(broker, true); else ! document = ((LocalBinaryResource) resource).getDocument(broker, true); if (!document.getPermissions().getOwner().equals(user.getName()) && !manager.hasAdminPrivileges(user)) *************** *** 229,233 **** document = ((LocalXMLResource) resource).getDocument(broker, true); else ! document = ((LocalBinaryResource) resource).getBlob(); if (!document.getPermissions().getOwner().equals(user.getName()) && !manager.hasAdminPrivileges(user)) --- 229,233 ---- document = ((LocalXMLResource) resource).getDocument(broker, true); else ! document = ((LocalBinaryResource) resource).getDocument(broker, true); if (!document.getPermissions().getOwner().equals(user.getName()) && !manager.hasAdminPrivileges(user)) *************** *** 302,307 **** document = ((LocalXMLResource) res).getDocument(broker, true); perm = document.getPermissions(); ! } else ! perm = ((LocalBinaryResource) res).getBlob().getPermissions(); perm.setOwner(u); perm.setGroup(group); --- 302,309 ---- document = ((LocalXMLResource) res).getDocument(broker, true); perm = document.getPermissions(); ! } else { ! document = ((LocalBinaryResource) res).getDocument(broker, true); ! perm = ((LocalBinaryResource) res).getPermissions(); ! } perm.setOwner(u); perm.setGroup(group); *************** *** 335,339 **** doc = ((LocalXMLResource) res).getDocument(broker, true); else ! doc = ((LocalBinaryResource) res).getBlob(); User lockOwner = doc.getUserLock(); return lockOwner == null ? null : lockOwner.getName(); --- 337,341 ---- doc = ((LocalXMLResource) res).getDocument(broker, true); else ! doc = ((LocalBinaryResource) res).getDocument(broker, true); User lockOwner = doc.getUserLock(); return lockOwner == null ? null : lockOwner.getName(); *************** *** 357,361 **** doc = ((LocalXMLResource) res).getDocument(broker, true); else ! doc = ((LocalBinaryResource) res).getBlob(); if (!doc.getPermissions().validate(user, Permission.UPDATE)) throw new XMLDBException(ErrorCodes.PERMISSION_DENIED, --- 359,363 ---- doc = ((LocalXMLResource) res).getDocument(broker, true); else ! doc = ((LocalBinaryResource) res).getDocument(broker, true); if (!doc.getPermissions().validate(user, Permission.UPDATE)) throw new XMLDBException(ErrorCodes.PERMISSION_DENIED, *************** *** 397,401 **** doc = ((LocalXMLResource) res).getDocument(broker, true); else ! doc = ((LocalBinaryResource) res).getBlob(); if (!doc.getPermissions().validate(user, Permission.UPDATE)) throw new XMLDBException(ErrorCodes.PERMISSION_DENIED, --- 399,403 ---- doc = ((LocalXMLResource) res).getDocument(broker, true); else ! doc = ((LocalBinaryResource) res).getDocument(broker, true); if (!doc.getPermissions().validate(user, Permission.UPDATE)) throw new XMLDBException(ErrorCodes.PERMISSION_DENIED, *************** *** 438,442 **** return ((LocalXMLResource) resource).getDocument(broker, false).getPermissions(); else ! return ((LocalBinaryResource) resource).getBlob().getPermissions(); } catch (EXistException e) { throw new XMLDBException( --- 440,444 ---- return ((LocalXMLResource) resource).getDocument(broker, false).getPermissions(); else ! return ((LocalBinaryResource) resource).getDocument(broker, false).getPermissions(); } catch (EXistException e) { throw new XMLDBException( Index: LocalXPathQueryService.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/LocalXPathQueryService.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** LocalXPathQueryService.java 27 Jun 2004 21:10:09 -0000 1.42 --- LocalXPathQueryService.java 2 Jul 2004 16:53:53 -0000 1.43 *************** *** 108,112 **** try { broker = brokerPool.get(user); ! docs = collection.getCollection().allDocs(broker, new DocumentSet(), true); } catch (EXistException e) { throw new XMLDBException( --- 108,112 ---- try { broker = brokerPool.get(user); ! docs = collection.getCollection().allDocs(broker, new DocumentSet(), true, true); } catch (EXistException e) { throw new XMLDBException( *************** *** 151,155 **** broker = brokerPool.get(user); if(docs == null) { ! docs = collection.getCollection().allDocs(broker, new DocumentSet(), true); } --- 151,155 ---- broker = brokerPool.get(user); if(docs == null) { ! docs = collection.getCollection().allDocs(broker, new DocumentSet(), true, true); } *************** *** 181,185 **** try { broker = brokerPool.get(user); ! DocumentSet docs = collection.getCollection().allDocs(broker, new DocumentSet(), true); XQuery xquery = broker.getXQueryService(); --- 181,185 ---- try { broker = brokerPool.get(user); ! DocumentSet docs = collection.getCollection().allDocs(broker, new DocumentSet(), true, true); XQuery xquery = broker.getXQueryService(); Index: LocalCollection.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/LocalCollection.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** LocalCollection.java 8 Jun 2004 08:16:08 -0000 1.33 --- LocalCollection.java 2 Jul 2004 16:53:53 -0000 1.34 *************** *** 277,281 **** r = new LocalXMLResource(user, brokerPool, this, id, -1); else if (document.getResourceType() == DocumentImpl.BINARY_FILE) ! r = new LocalBinaryResource(user, brokerPool, this, (BinaryDocument) document); else throw new XMLDBException( --- 277,281 ---- r = new LocalXMLResource(user, brokerPool, this, id, -1); else if (document.getResourceType() == DocumentImpl.BINARY_FILE) ! r = new LocalBinaryResource(user, brokerPool, this, id); else throw new XMLDBException( *************** *** 453,457 **** res.getId(), (byte[]) res.getContent()); - res.blob = blob; } catch (Exception e) { throw new XMLDBException( --- 453,456 ---- Index: LocalXMLResource.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/LocalXMLResource.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** LocalXMLResource.java 8 Jun 2004 08:16:08 -0000 1.35 --- LocalXMLResource.java 2 Jul 2004 16:53:53 -0000 1.36 *************** *** 137,141 **** throw new XMLDBException(ErrorCodes.PERMISSION_DENIED, "permission denied to read resource"); - if (id < 0) content = serializer.serialize(document); --- 137,140 ---- |
From: Wolfgang M. M. <wol...@us...> - 2004-07-02 16:54:32
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15785/src/org/exist/xquery Modified Files: DynamicAttributeConstructor.java Removed Files: SystemFunctions.java Log Message: Fixed resource read/write permissions check. --- SystemFunctions.java DELETED --- Index: DynamicAttributeConstructor.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/DynamicAttributeConstructor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DynamicAttributeConstructor.java 27 Jun 2004 21:10:06 -0000 1.1 --- DynamicAttributeConstructor.java 2 Jul 2004 16:53:53 -0000 1.2 *************** *** 55,59 **** } ! public void setValueExpr(Expression expr) { this.valueExpr = new Atomize(context, expr); } --- 55,59 ---- } ! public void setContentExpr(Expression expr) { this.valueExpr = new Atomize(context, expr); } *************** *** 64,67 **** --- 64,68 ---- public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException { + System.out.println(pprint()); MemTreeBuilder builder = context.getDocumentBuilder(); context.proceed(this, builder); |
From: Wolfgang M. M. <wol...@us...> - 2004-07-02 16:54:06
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15785/src/org/exist/storage Modified Files: NativeBroker.java Log Message: Fixed resource read/write permissions check. Index: NativeBroker.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/NativeBroker.java,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** NativeBroker.java 29 Jun 2004 14:26:48 -0000 1.84 --- NativeBroker.java 2 Jul 2004 16:53:57 -0000 1.85 *************** *** 335,339 **** long start = System.currentTimeMillis(); Collection root = getCollection(ROOT_COLLECTION); ! root.allDocs(this, docs, true); if (LOG.isDebugEnabled()) { LOG.debug("getAllDocuments(DocumentSet) - end - " --- 335,339 ---- long start = System.currentTimeMillis(); Collection root = getCollection(ROOT_COLLECTION); ! root.allDocs(this, docs, true, false); if (LOG.isDebugEnabled()) { LOG.debug("getAllDocuments(DocumentSet) - end - " *************** *** 514,519 **** return null; } ! if (!doc.getPermissions().validate(user, Permission.READ)) ! throw new PermissionDeniedException("not allowed to read document"); return doc; } --- 514,519 ---- return null; } ! // if (!doc.getPermissions().validate(user, Permission.READ)) ! // throw new PermissionDeniedException("not allowed to read document"); return doc; } *************** *** 541,545 **** return docs; } ! docs = root.allDocs(this, docs, inclusive); LOG.debug( "loading " --- 541,545 ---- return docs; } ! docs = root.allDocs(this, docs, inclusive, false); LOG.debug( "loading " *************** *** 1905,1908 **** --- 1905,1911 ---- throw new PermissionDeniedException("Insufficient privileges to move resource " + doc.getFileName()); + if(!doc.getPermissions().validate(user, Permission.WRITE)) + throw new PermissionDeniedException("Insufficient privileges to move resource " + + doc.getFileName()); if(newName == null) { int p = doc.getFileName().lastIndexOf('/'); |
From: Wolfgang M. M. <wol...@us...> - 2004-07-02 16:54:06
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/dom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15785/src/org/exist/dom Modified Files: DocumentSet.java Log Message: Fixed resource read/write permissions check. Index: DocumentSet.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/DocumentSet.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** DocumentSet.java 8 Jun 2004 08:16:08 -0000 1.16 --- DocumentSet.java 2 Jul 2004 16:53:57 -0000 1.17 *************** *** 108,120 **** * @param docs */ ! public void addAll(DBBroker broker, java.util.Collection docs) { DocumentImpl doc; for(Iterator i = docs.iterator(); i.hasNext(); ) { doc = (DocumentImpl)i.next(); - if(broker == null || doc.getPermissions().validate(broker.getUser(), Permission.READ)) { // if(doc.isLockedForWrite()) // continue; ! put(doc.getDocId(), doc); ! } } } --- 108,121 ---- * @param docs */ ! public void addAll(DBBroker broker, java.util.Collection docs, boolean checkPermissions) { DocumentImpl doc; for(Iterator i = docs.iterator(); i.hasNext(); ) { doc = (DocumentImpl)i.next(); // if(doc.isLockedForWrite()) // continue; ! if(broker == null || !checkPermissions || ! doc.getPermissions().validate(broker.getUser(), Permission.READ)) { ! put(doc.getDocId(), doc); ! } } } |
From: Wolfgang M. M. <wol...@us...> - 2004-07-02 16:54:06
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15785/src/org/exist/xmlrpc Modified Files: RpcConnection.java Log Message: Fixed resource read/write permissions check. Index: RpcConnection.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc/RpcConnection.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** RpcConnection.java 8 Jun 2004 08:16:12 -0000 1.61 --- RpcConnection.java 2 Jul 2004 16:53:56 -0000 1.62 *************** *** 221,225 **** docs = new DocumentSet(); Collection root = broker.getCollection(baseURI); ! root.allDocs(broker, docs, true); } } --- 221,225 ---- docs = new DocumentSet(); Collection root = broker.getCollection(baseURI); ! root.allDocs(broker, docs, true, true); } } *************** *** 438,441 **** --- 438,443 ---- return null; } + if(!collection.getPermissions().validate(user, Permission.READ)) + throw new PermissionDeniedException("Insufficient privileges to read resource"); doc = collection.getDocumentWithLock(broker, docName); if (doc == null) { *************** *** 443,446 **** --- 445,450 ---- throw new EXistException("document not found"); } + if(!doc.getPermissions().validate(user, Permission.READ)) + throw new PermissionDeniedException("Insufficient privileges to read resource " + docName); Serializer serializer = broker.getSerializer(); *************** *** 540,543 **** --- 544,549 ---- throw new EXistException("Document " + name + " is not a binary resource"); + if(!doc.getPermissions().validate(user, Permission.READ)) + throw new PermissionDeniedException("Insufficient privileges to read resource"); return broker.getBinaryResourceData((BinaryDocument) doc); } finally { *************** *** 557,561 **** + " not found"); DocumentSet docs = collection.allDocs(broker, new DocumentSet(), ! true); XUpdateProcessor processor = new XUpdateProcessor(broker, docs); Modification modifications[] = processor.parse(new InputSource( --- 563,567 ---- + " not found"); DocumentSet docs = collection.allDocs(broker, new DocumentSet(), ! true, true); XUpdateProcessor processor = new XUpdateProcessor(broker, docs); Modification modifications[] = processor.parse(new InputSource( *************** *** 582,588 **** try { broker = brokerPool.get(user); ! Document doc = broker.getDocument(resource); if (doc == null) throw new EXistException("document " + resource + " not found"); DocumentSet docs = new DocumentSet(); docs.add(doc); --- 588,596 ---- try { broker = brokerPool.get(user); ! DocumentImpl doc = (DocumentImpl)broker.getDocument(resource); if (doc == null) throw new EXistException("document " + resource + " not found"); + if(!doc.getPermissions().validate(user, Permission.READ)) + throw new PermissionDeniedException("Insufficient privileges to read resource"); DocumentSet docs = new DocumentSet(); docs.add(doc); *************** *** 1574,1577 **** --- 1582,1587 ---- broker = brokerPool.get(user); DocumentImpl doc = (DocumentImpl) broker.getDocument(path); + if(!doc.getPermissions().validate(user, Permission.READ)) + throw new PermissionDeniedException("Insufficient privileges to read resource"); if (doc == null) throw new EXistException("Resource " + path + " not found"); |