Improper matching/validation of mount-control

Bug #1974055 reported by Daniel Manrique
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
review-tools
New
Undecided
Unassigned

Bug Description

The snap has this:

mntctl:
    interface: mount-control
    mount:
    - what: /dev/sd*
      where: /mnt/*
      type:
      - vfat
      options:
      - rw
      - sync
      - async
      persistent: false

The snap declaration json has this:

{
"mount-control": {
    "allow-auto-connection": {
      "on-store": [
        "honeywell-international-inc"
      ],
      "plug-attributes": {
        "mount": [
          {
            "options": [
              "rw",
              "sync",
              "async"
            ],
            "persistent": false,
            "type": [
              "vfat"
            ],
            "what": "/dev/sd\\*",
            "where": "/mnt/\\*"
          }
        ]
      }
    },
    "allow-installation": {
      "on-store": [
        "honeywell-international-inc"
      ],
      "plug-attributes": {
        "mount": [
          {
            "options": [
              "rw",
              "sync",
              "async"
            ],
            "persistent": "false",
            "type": [
              "vfat"
            ],
            "what": "/dev/sd\\*",
            "where": "/mnt/\\*"
          }
        ]
      }
    }
  }
}

I think these should match, but review-tools says:

- declaration-snap-v2:plugs_installation:mntctl:mount-control
 human review required due to 'allow-installation' constraint (interface attributes)

Please let me know via direct message if you need more specifics, I can point you to the concrete snap that is having this issue.

- Daniel

Related branches

Revision history for this message
Alex Murray (alexmurray) wrote :

I have proposed a fix for this in review-tools but the current proposal means your declaration would have to change to be the following:

    "mount-control": {
        "allow-installation": [
            {
                "plug-attributes": {
                  "mount": [
                    {
                      "where": "/mnt/\\*",
                      "what": "/dev/sd\\*",
                      "type": "vfat",
                      "persistent": "false",
                      "options": "(rw|a?sync)"
                    }
                  ]
                },
                "on-store": [
                    "honeywell-international-inc"
                ]
            }
        ],
        "allow-auto-connection": {
            "plug-attributes": {
              "mount": [
                {
                  "where": "/mnt/\\*",
                  "what": "/dev/sd\\*",
                  "type": "vfat",
                  "persistent": "false",
                  "options": "(rw|a?sync)"
                }
              ]
            },
            "on-store": [
                "honeywell-international-inc"
            ]
        }
    },

Revision history for this message
Daniel Manrique (roadmr) wrote :

This is fine, we can update the snap declaration to use regexes instead.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.