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

Quote and escape special chars in mapping fs #206

Merged
merged 2 commits into from Nov 2, 2023

Conversation

smortex
Copy link
Member

@smortex smortex commented Nov 2, 2023

Multiple filesystems can be provided for a mapping by separating them
with spaces. Some implementations of autofs do support spaces in path
if proper quoting is in place.

When managing a filesystems with spaces in its path, the end-user of
the module was responsible for the correct quoting because the module
interface only accept a single string for the "raw" value.

Change the data type of the parameter to accept either a String
(single filesystem) or an Array[String] (multiple filesystems) and
transfer the responsibility of escaping to the module.

This is a breaking change that may affect some users:

  1. Users of mapping with multiple filesystems will need to split their
    fs parameter to provide an array of filesystems;
  2. Users of mappings with quoted special chars will have to remove the
    quoting to avoid double-quoting.

Previously, a mapping key could not include spaces because of the data
type.  Some implementations of autofs do support such keys when they are
properly quoted so do not limit their use with the module and properly
quote the key when it has special characters.

These chars still need to be manualy espaced when used with the fs
parameter because it is managed as a single String. This will be
addressed in a follow-up commit as it will be a breaking change.
Multiple filesystems can be provided for a mapping by separating them
with spaces.  Some implementations of autofs do support spaces in path
if proper quoting is in place.

When managing a filesystems with spaces in its path, the end-user of
the module was responsible for the correct quoting because the module
interface only accept a single string for the "raw" value.

Change the data type of the parameter to accept either a `String`
(single filesystem) or an `Array[String]` (multiple filesystems) and
transfer the responsibility of escaping to the module.

This is a breaking change that may affect some users:

1. Users of mapping with multiple filesystems will need to split their
   `fs` parameter to provide an array of filesystems;
2. Users of mappings with quoted special chars will have to remove the
   quoting to avoid double-quoting.
@smortex smortex merged commit a82bdec into master Nov 2, 2023
34 checks passed
@smortex smortex deleted the escape-special-char-in-mapping-fs branch November 2, 2023 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants