[4.0.4] Equal sign is not allowed in a command

Bug #1882839 reported by Dmitrii Shcherbakov
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Snapcraft
Triaged
Wishlist
Unassigned
snapd
Confirmed
Wishlist
Samuele Pedroni

Bug Description

I believe '=' used to be allowed in earlier versions of snapcraft but now it is not:

Failed to generate snap metadata: The specified command 'ovs-wrapper $SNAP/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server --no-monitor --system-id=random start' defined in the app 'ovs-vswitchd' does not match the pattern expected by snapd.
The command must consist only of alphanumeric characters, spaces, and the following special characters: / . _ # : $ -

The equal sign is often used in command line arguments:

  ovs-vswitchd:
    command: ovs-wrapper $SNAP/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server --no-monitor --system-id=random start
    stop-command: ovs-wrapper $SNAP/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server stop
    after: [ovsdb-server]
    daemon: forking
    plugs:
      - network
      - network-bind
      - network-control
      - openvswitch-support
      - process-control
      - system-trace
      - microstack-support

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

This is correct, one of the goals of core20 was to get rid of wrappers, to do so, we now only allow a command entry that snapd would accept. So this is essentially a snapd feature request.

Changed in snapcraft:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Colin Ian King (colin-king) wrote :

Is this deprecated feature in the release notes anywhere?

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

I added a note for when we first released this https://github.com/snapcore/snapcraft/releases/tag/3.9

And amended https://github.com/snapcore/snapcraft/releases/tag/4.0 with a Commands section.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I had a look at the code and this is indeed the way the validator works. I'll discuss if allowing = would be allowed.

Changed in snapd:
status: New → Confirmed
importance: Undecided → Low
importance: Low → Wishlist
assignee: nobody → Samuele Pedroni (pedronis)
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Assigned to Samuele for design decisions.

Revision history for this message
Lucy Llewellyn (lucyllewy) wrote :

Also quotes are desirable, such as when trying to pass a parameter with spaces in it. (ref: https://forum.snapcraft.io/t/spaces-in-executable-path/22229/)

Revision history for this message
Zack (zacklee) wrote :

There seems to be another thread from 2019 with regards to the same ask: https://bugs.launchpad.net/snapcraft/+bug/1820055 which is already in Triaged status. It would be good to merge these two threads and get this moving along...

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.