Skip to content

Commit

Permalink
i/builtin: allow @ in custom-device filepaths
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
  • Loading branch information
olivercalder committed Nov 13, 2024
1 parent 1d38c1c commit 4f2755d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion interfaces/builtin/custom_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var (
customDeviceInternalError = errors.New(`custom-device interface internal error`)

// Validating regexp for filesystem paths
customDevicePathRegexp = regexp.MustCompile(`^/[^"@]*$`)
customDevicePathRegexp = regexp.MustCompile(`^/[^"]*$`)

// Validating regexp for udev device names.
// We forbid:
Expand Down
8 changes: 3 additions & 5 deletions interfaces/builtin/custom_device_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ slots:
read-devices:
- /dev/js*
files:
write: [ /bar ]
write: [ /bar, /baz@qux ]
read:
- /dev/input/by-id/*
- /dev/dma_heap/qcom,qseecom
- /sys/devices/platform/soc@0/soc@0:bus@30000000/30350000.ocotp-ctrl/imx-ocotp0/nvmem
udev-tagging:
- kernel: input/mice
subsystem: input
Expand Down Expand Up @@ -208,10 +210,6 @@ apps:
"devices: [/dev/foo**]",
`custom-device "devices" path contains invalid glob pattern "\*\*"`,
},
{
"devices: [/dev/@foo]",
`custom-device "devices" path must start with / and cannot contain special characters.*`,
},
{
"devices: [/dev/foo|bar]",
`custom-device "devices" path must start with /dev/ and cannot contain special characters.*`,
Expand Down

0 comments on commit 4f2755d

Please sign in to comment.