Skip to content

lib/fs: Clarify errors for Windows filenames (fixes #8968) - #8969

Merged
calmh merged 2 commits into
syncthing:mainfrom
calmh:clarifyerrors
Jul 7, 2023
Merged

calmh merged 2 commits into
syncthing:mainfrom
calmh:clarifyerrors

Conversation

@calmh

@calmh calmh commented Jul 6, 2023 •

Copy link
Copy Markdown
Member

With this change, error messages include the offending characters or name parts. Examples:

nul.txt: name is invalid, contains Windows reserved name: "nul"
foo>bar.txt: name is invalid, contains Windows reserved character: ">"
foo \bar.txt: name is invalid, must not end in space or period on Windows

(the last one refers to the foo component)

With this change, error messages include the offending characters or
name parts. Examples:

    nul.txt: name is invalid, contains Windows reserved name: "nul"
    foo>bar.txt: name is invalid, contains Windows reserved character: ">"
    foo \bar.txt: name is invalid, must not end in space or period on Windows
Comment thread lib/fs/util.go Outdated
}

func windowsIsReserved(part string) bool {
func windowsIsReserved(part string) (string, bool) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty string could be enough to indicate not found imo.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah

@calmh
calmh enabled auto-merge (squash) July 7, 2023 10:50
@calmh
calmh merged commit c44de2c into syncthing:main Jul 7, 2023
@calmh calmh added this to the v1.23.7 milestone Jul 10, 2023
calmh added a commit to calmh/syncthing that referenced this pull request Jul 10, 2023
* main: (29 commits)
  cmd/ursrv: Remove old, unused user movement code
  cmd/ursrv: Merge ursrv and uraggregate as subcommands
  cmd/ursrv: Remove useless static TLS cert handling
  cmd/ursrv: Embed static assets
  cmd/ursrv: Refactor to use CLI options, fewer global vars
  gui: Show xattr filter editor when send xattrs checked (fixes syncthing#8958) (syncthing#8959)
  gui, man, authors: Update docs, translations, and contributors
  build: Build Docker image for plain 32 bit arm (fixes syncthing#8973)
  lib/fs: Clarify errors for Windows filenames (fixes syncthing#8968) (syncthing#8969)
  gui: Avoid spurious comma in shared-with device list (fixes syncthing#8967) (syncthing#8970)
  cmd/ursrv: Summarize tiny fraction items into Other
  cmd/ursrv: Update distributions list
  build: Only push releases to cloud storage, and also use `latest`
  readme: Remove outdated build badges/links
  build: Push to correct Docker images
  build: Build and publish Docker images for relay and discovery server (fixes syncthing#8691, fixes syncthing#8960)
  gui, man, authors: Update docs, translations, and contributors
  build: Build and publish Docker images for relay and discovery server (fixes syncthing#8691, fixes syncthing#8960)
  build: Build infrastructure images
  cmd/stcrashreceiver: Add /ping endpoint
  ...
calmh added a commit to calmh/syncthing that referenced this pull request Jul 17, 2023
* main: (27 commits)
  gui, man, authors: Update docs, translations, and contributors
  cmd/syncthing: Mention STVERSIONEXTRA in --help output (ref syncthing#8980)
  gui, lib/api: Add possibility to feed through extra version information (syncthing#8980)
  cmd/ursrv: Update map tile URL
  cmd/strelaypoolsrv: Update map tile URL (syncthing#8985)
  cmd/stcrashreceiver: Correct parsing of current version string
  build: Update dependencies
  cmd/ursrv: Remove old, unused user movement code
  cmd/ursrv: Merge ursrv and uraggregate as subcommands
  cmd/ursrv: Remove useless static TLS cert handling
  cmd/ursrv: Embed static assets
  cmd/ursrv: Refactor to use CLI options, fewer global vars
  gui: Show xattr filter editor when send xattrs checked (fixes syncthing#8958) (syncthing#8959)
  gui, man, authors: Update docs, translations, and contributors
  build: Build Docker image for plain 32 bit arm (fixes syncthing#8973)
  lib/fs: Clarify errors for Windows filenames (fixes syncthing#8968) (syncthing#8969)
  gui: Avoid spurious comma in shared-with device list (fixes syncthing#8967) (syncthing#8970)
  cmd/ursrv: Summarize tiny fraction items into Other
  cmd/ursrv: Update distributions list
  build: Only push releases to cloud storage, and also use `latest`
  ...
calmh added a commit that referenced this pull request Jul 17, 2023
* main: (42 commits)
  gui, man, authors: Update docs, translations, and contributors
  cmd/syncthing: Mention STVERSIONEXTRA in --help output (ref #8980)
  gui, lib/api: Add possibility to feed through extra version information (#8980)
  cmd/ursrv: Update map tile URL
  cmd/strelaypoolsrv: Update map tile URL (#8985)
  cmd/stcrashreceiver: Correct parsing of current version string
  build: Update dependencies
  cmd/ursrv: Remove old, unused user movement code
  cmd/ursrv: Merge ursrv and uraggregate as subcommands
  cmd/ursrv: Remove useless static TLS cert handling
  cmd/ursrv: Embed static assets
  cmd/ursrv: Refactor to use CLI options, fewer global vars
  gui: Show xattr filter editor when send xattrs checked (fixes #8958) (#8959)
  gui, man, authors: Update docs, translations, and contributors
  build: Build Docker image for plain 32 bit arm (fixes #8973)
  lib/fs: Clarify errors for Windows filenames (fixes #8968) (#8969)
  gui: Avoid spurious comma in shared-with device list (fixes #8967) (#8970)
  cmd/ursrv: Summarize tiny fraction items into Other
  cmd/ursrv: Update distributions list
  build: Only push releases to cloud storage, and also use `latest`
  ...
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Jul 6, 2024
@syncthing syncthing locked and limited conversation to collaborators Jul 6, 2024
@calmh
calmh deleted the clarifyerrors branch May 26, 2025 13:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants