Skip to content

Incorrect handling of path for auto accepted folder #8859

@calmh

Description

@calmh

There's a problem in the logic for auto-accepted folders. The idea is that the folder should be placed in a subdirectory to the "default folder path", with the subdirectory name generated from the folder label or ID, in that order. We ensure that this path doesn't exist before starting to use it. However,

  1. if the label (or sanitised ID) is empty, Syncthing will try to use the default folder path itself
  2. if we're auto-accepting multiple folders at the same time, we might add two or more with the same path, because the folder path isn't created until later when the folder is started.

By default, the default folder path is the user home directory which is very likely to already exist (or Syncthing is likely to be unable to create it), and if it's something else it's guaranteed to exist once a folder has been accepted. This should make point one a fairly rare problem "in the wild". Point two is a problem only when multiple folders with identical labels are shared simultaneously.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions