Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bisync: trailing slash in local path arg on Windows causes error #7511

Closed
nielash opened this issue Dec 18, 2023 · 0 comments · Fixed by #7515
Closed

bisync: trailing slash in local path arg on Windows causes error #7511

nielash opened this issue Dec 18, 2023 · 0 comments · Fixed by #7515

Comments

@nielash
Copy link
Collaborator

nielash commented Dec 18, 2023

The associated forum post URL from https://forum.rclone.org

https://forum.rclone.org/t/rclone-cant-create-file-system/43471/18?u=nielash

What is the problem you are having with rclone?

A trailing slash in a quoted local path command arg on Windows causes a fatal error. Example:

bisync --resync QuickAccess: "U:\Documents\OneDrive1\" --config "U:\Settings\Rclone\config" -vv

results in an error like:

2023/12/15 12:05:36 Failed to bisync: prior lock file found: C:\Users\Graeme\AppData\Local\rclone\bisync\C__Users_Graeme_QuickAccess..U__Documents_OneDrive1"_--config_U__Settings_Rclone_config_-vv.lck

Reported on the forum by a user, and I was able to reproduce it. Removing the trailing slash resolves the issue (confirmed by user). While the fix is easy, it's not immediately obvious, so I think it would be worth trying to catch this and handle it better. Looks like possibly the backslash is being interpreted as escaping the quote -- probably an easy fix.

What is your rclone version (output from rclone version)

rclone v1.65.0
- os/version: Microsoft Windows 11 Home 23H2 (64 bit)
- os/kernel: 10.0.22631.2861 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.21.4
- go/linking: static
- go/tags: cmount

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.
@nielash nielash added this to the Soon milestone Dec 18, 2023
@nielash nielash self-assigned this Dec 18, 2023
nielash added a commit to nielash/rclone that referenced this issue Dec 22, 2023
Before this change, certain shell quoting / escaping errors (particularly on
Windows) were not detected by Bisync, possibly resulting in incorrect expansion
and confusing errors. In particular, Windows paths with a single trailing
backslash followed by a quote would be interpreted as an escaped quote --
resulting in the quote and subsequent flags being erroneously considered part
of the path.

After this change, Bisync specifically checks for a few of the most common
patterns, and if detected, exits with a more helpful error message before doing
any damage.
@nielash nielash linked a pull request Dec 22, 2023 that will close this issue
5 tasks
nielash added a commit to nielash/rclone that referenced this issue Jan 20, 2024
Before this change, certain shell quoting / escaping errors (particularly on
Windows) were not detected by Bisync, possibly resulting in incorrect expansion
and confusing errors. In particular, Windows paths with a single trailing
backslash followed by a quote would be interpreted as an escaped quote --
resulting in the quote and subsequent flags being erroneously considered part
of the path.

After this change, Bisync specifically checks for a few of the most common
patterns, and if detected, exits with a more helpful error message before doing
any damage.
nielash added a commit that referenced this issue Jan 20, 2024
Before this change, certain shell quoting / escaping errors (particularly on
Windows) were not detected by Bisync, possibly resulting in incorrect expansion
and confusing errors. In particular, Windows paths with a single trailing
backslash followed by a quote would be interpreted as an escaped quote --
resulting in the quote and subsequent flags being erroneously considered part
of the path.

After this change, Bisync specifically checks for a few of the most common
patterns, and if detected, exits with a more helpful error message before doing
any damage.
miku added a commit to internetarchive/rclone that referenced this issue Jan 23, 2024
* master: (86 commits)
  fs: add more detailed logging for file includes/excludes
  bisync: add --resync-mode for customizing --resync - fixes rclone#5681
  bisync: fix --colors flag
  bisync: factor resync to separate file
  bisync: skip empty test case dirs
  bisync: add options to auto-resolve conflicts - fixes rclone#7471
  bisync: check for syntax errors in path args - fixes rclone#7511
  bisync: add overlapping paths check
  bisync: allow lock file expiration/renewal with --max-lock - rclone#7470
  bisync: Graceful Shutdown, --recover from interruptions without --resync - fixes rclone#7470
  bisync: full support for comparing checksum, size, modtime - fixes rclone#5679 fixes rclone#5683 fixes rclone#5684 fixes rclone#5675
  bisync: document beta status more clearly - fixes rclone#6082
  bisync: normalize session name to non-canonical - fixes rclone#7423
  bisync: update version number in docs
  bisync: account for differences in backend features on integration tests - see rclone#5679
  operations: fix renaming a file on macOS
  bisync: fallback to cryptcheck or --download when can't check hash
  local: fix cleanRootPath on Windows after go1.21.4 stdlib update
  bisync: support two --backup-dir paths on different remotes
  bisync: support files with unknown length, including Google Docs - fixes rclone#5696
  ...
Fornax96 pushed a commit to Fornaxian/rclone that referenced this issue Jul 30, 2024
Before this change, certain shell quoting / escaping errors (particularly on
Windows) were not detected by Bisync, possibly resulting in incorrect expansion
and confusing errors. In particular, Windows paths with a single trailing
backslash followed by a quote would be interpreted as an escaped quote --
resulting in the quote and subsequent flags being erroneously considered part
of the path.

After this change, Bisync specifically checks for a few of the most common
patterns, and if detected, exits with a more helpful error message before doing
any damage.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant