Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-22825

Fix escaping issue when retrieving child sync roots

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 7.10, 8.10, 9.2
    • Fix Version/s: 7.10-HF31, 8.10-HF14, 9.3
    • Component/s: Nuxeo Drive
    • Release Notes Summary:
      Child sync roots are escaped when retrieved
    • Backlog priority:
      500
    • Sprint:
      nxfit 9.3.5
    • Story Points:
      3

      Description

      1. install nuxeo 7.10
      2. install nuxeo-drive add-on
      3. in the personal workspace create a document of type File, containing a quote
      4. modify the permissions of this document
      5. logs show the following stack trace:
        2017-07-27 16:38:45,313 ERROR [http-bio-0.0.0.0-8080-exec-31] [org.nuxeo.ecm.core.event.impl.EventServiceImpl] Exception during nuxeoDriveFileSystemDeletionListener sync listener execution, continuing to run other listeners
        org.nuxeo.ecm.core.query.QueryParseException: Failed to execute query: SELECT * FROM Document WHERE ecm:mixinType = 'DriveSynchronized' AND ecm:currentLifeCycleState != 'deleted' AND ecm:path STARTSWITH '/default-domain/UserWorkspaces/Administrator/myFolder/truc/SOMEHWERE SOMETHING/mySuper'Quote', Syntax error: Invalid token <Quote> at offset 223
        	at org.nuxeo.ecm.core.query.sql.parser.parser.parseFailed(parser.java:519)
        	at org.nuxeo.ecm.core.query.sql.parser.parser.unrecovered_syntax_error(parser.java:510)
        	at java_cup.runtime.lr_parser.parse(lr_parser.java:601)
        	at org.nuxeo.ecm.core.query.sql.SQLQueryParser.parse(SQLQueryParser.java:39)
        	at org.nuxeo.ecm.core.query.sql.SQLQueryParser.parse(SQLQueryParser.java:48)
        	at org.nuxeo.ecm.core.storage.sql.jdbc.NXQLQueryMaker.buildQuery(NXQLQueryMaker.java:281)
        	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapper.queryProjection(JDBCMapper.java:799)
        	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapper.query(JDBCMapper.java:736)
        	at sun.reflect.GeneratedMethodAccessor152.invoke(Unknown Source)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        

      The issue is in NuxeoDriveFileSystemDeletionListener and Path:

          protected List<DocumentModel> getChildSyncRoots(DocumentModel doc, CoreSession session) {
              String nxql = "SELECT * FROM Document WHERE ecm:mixinType = '" + NuxeoDriveManagerImpl.NUXEO_DRIVE_FACET
                      + "' AND ecm:currentLifeCycleState != 'deleted' AND ecm:path STARTSWITH '" + doc.getPathAsString()
                      + "'";
              return session.query(nxql);
          }
      

      The path retrieved by doc.getPathAsString() is unescaped.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours
                  3h