Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-1941

Handle invalid filenames when solving duplicate issue in the RemoteWatcher

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.4
    • Fix Version/s: 4.4.0
    • Component/s: Remote watcher

      Description

      Error

      Sentry Issue: NUXEO-DRIVE-26Z

      ValueError: Invalid name 'Congés 2016 / 2017'
        File "nxdrive\engine\watcher\remote_watcher.py", line 613, in _handle_changes
        File "nxdrive\engine\activity.py", line 223, in func_wrapper
        File "nxdrive\engine\watcher\remote_watcher.py", line 890, in _update_remote_states
        File "pathlib.py", line 830, in with_name
      

      Analysis

      The error is at that line:

      doc_pair.local_path.with_name(new_info.name)
      

      The name is not filtered and so, when it contains invalid characters like "/", the error happens.

      Fix

      The name should be sanitized using the safe_filename() function.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours, 45 minutes
                  2h 45m