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

[Direct Edit] Sanitize the filename

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: NoFixVersionApplicable
    • Fix Version/s: 5.2.2
    • Component/s: Direct Edit
    • Release Notes Summary:
      Handle forbidden filenames
    • Release Notes Description:
      Hide

      In previous versions it was not possible to Direct Edit a file which name contained characters that are forbidden by the OS (ex: backslash on Windows). Those files are now handled correctly.

      Show
      In previous versions it was not possible to Direct Edit a file which name contained characters that are forbidden by the OS (ex: backslash on Windows). Those files are now handled correctly.
    • Epic Link:
    • Sprint:
      nxDrive 11.2.23
    • Story Points:
      1

      Description

      Error

      Sentry Issue: NUXEO-DRIVE-20R

      OSError: [WinError 87] Paramètre incorrect: 'C:\\Users\\USER\\.nuxeo-drive\\edit\\DOCUID.dl\\palette : 10 VERITABLES CREPES BRETONNES TOUTES MARQUES.docx' -> 'C:\\Users\\assqua\\.nuxeo-drive\\edit\\DOCUID_files-files-0-file\\palette : 10 VERITABLES CREPES BRETONNES TOUTES MARQUES.docx'
        File "nxdrive\direct_edit.py", line 513, in edit
        File "nxdrive\direct_edit.py", line 500, in edit
        File "nxdrive\direct_edit.py", line 482, in _prepare_edit
        File "nxdrive\utils.py", line 697, in safe_rename
        File "pathlib.py", line 1319, in rename
      

      Analysis

      The filename is not escaped, and ":" is forbidden on Windows.

      Fix

      Both lines should use safe_filename() to prevent such error.

      Expected result:

      • It must work as any other "normal" files:
        • The file is opened.
        • The file is locked on the server.
        • The file changes are updated.
        • The file is unlocked on the server.

        Attachments

        1. NUXEO-DRIVE-20R.json
          30 kB
          Mickaël Schoentgen
        2. NUXEO-DRIVE-55G.json
          39 kB
          Mickaël Schoentgen

          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 - 1 hour
                  1h