Skip to content

nixos/syncthing: fix escapes interpreted in declarative config#136121

Merged
bjornfor merged 1 commit into
NixOS:masterfrom
dermetfan:syncthing-escape
Aug 30, 2021
Merged

nixos/syncthing: fix escapes interpreted in declarative config#136121
bjornfor merged 1 commit into
NixOS:masterfrom
dermetfan:syncthing-escape

Conversation

@dermetfan

Copy link
Copy Markdown
Member
Motivation for this change

Dash echo interprets backslash escapes. This causes two consecutive backslashes in JSON to turn into a single one before the string is passed to jq, resulting in a parsing error.

This happened to me because I have backslashes in my folder IDs.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Fits CONTRIBUTING.md.

Dash `echo` interprets backslash escapes. This causes two consecutive backslashes in JSON to turn into a single one before the string is passed to jq, resulting in a parsing error.
@github-actions github-actions Bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Aug 29, 2021
@dermetfan dermetfan requested a review from ncfavier August 29, 2021 20:33

@ncfavier ncfavier left a comment

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.

Thanks, now I have something to point people to when they ask why I don't like echo.

@ofborg ofborg Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Aug 29, 2021
@bjornfor bjornfor merged commit ead3028 into NixOS:master Aug 30, 2021
@dermetfan dermetfan deleted the syncthing-escape branch August 30, 2021 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants