SNAP_CONFINE_DEBUG should not trigger on empty strings

Bug #1633276 reported by Zygmunt Krynicki
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snap-confine
Fix Released
Wishlist
Zygmunt Krynicki
snap-confine (Ubuntu)
New
Undecided
Unassigned
Xenial
Fix Committed
Undecided
Unassigned
Yakkety
Fix Committed
Undecided
Unassigned

Bug Description

[Impact]

snap-confine respects SNAP_CONFINE_DEBUG environment variable. The presence of this variable, regardless of what the value is, enables diagnostic output. To have more predictable and sane behaviour only specific values will trigger diagnostic output. The values are "yes", "no", "0" and "1".

[Test Case]

The test case can be found here:

https://github.com/snapcore/snap-confine/blob/master/spread-tests/main/debug-flags/task.yaml

The test case is ran automatically for each pull request and for each final release. It can be reproduced manually by executing the shell commands listed in the prepare/execute/restore phases manually.
The commands there assume that snapd and snap-confine are installed.
No other additional setup is necessary.

[Regression Potential]

 * Regression potential is almost non-existent as the debug mode is not enabled by default and it was even easier to enable previously.

[Other Info]

* snap-confine is technically an integral part of snapd which has an SRU exception and is allowed to introduce new features and take advantage of accelerated procedure. For more information see https://wiki.ubuntu.com/SnapdUpdates

== # Pre-SRU bug description follows # ==

The environment variable SNAP_CONFINE_DEBUG should respond to values like "yes" "no" "1" and "0" instead to just being defined (even if empty).

Zygmunt Krynicki (zyga)
Changed in snap-confine:
status: In Progress → Fix Released
Zygmunt Krynicki (zyga)
description: updated
Zygmunt Krynicki (zyga)
tags: added: verification-needed
Revision history for this message
Andy Whitcroft (apw) wrote : Please test proposed package

Hello Zygmunt, or anyone else affected,

Accepted snap-confine into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/snap-confine/1.0.44-0ubuntu1~16.10 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in snap-confine (Ubuntu Yakkety):
status: New → Fix Committed
Revision history for this message
Andy Whitcroft (apw) wrote :

Hello Zygmunt, or anyone else affected,

Accepted snap-confine into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/snap-confine/1.0.44-0ubuntu1~16.04 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in snap-confine (Ubuntu Xenial):
status: New → Fix Committed
Revision history for this message
Federico Gimenez (fgimenez) wrote :

Verified from the command line:

fgimenez@fgimenez-Standard-PC-i440FX-PIIX-1996:~$ for value in yes no 0 1 unicorn; do
> SNAP_CONFINE_DEBUG=$value ubuntu-core-launcher blah 2>debug.$value || :
> done
fgimenez@fgimenez-Standard-PC-i440FX-PIIX-1996:~$ cat debug.yes
DEBUG: shifting arguments by one
Usage: ubuntu-core-launcher <security-tag> <binary>
fgimenez@fgimenez-Standard-PC-i440FX-PIIX-1996:~$ cat debug.1
DEBUG: shifting arguments by one
Usage: ubuntu-core-launcher <security-tag> <binary>
fgimenez@fgimenez-Standard-PC-i440FX-PIIX-1996:~$ cat debug.no
Usage: ubuntu-core-launcher <security-tag> <binary>
fgimenez@fgimenez-Standard-PC-i440FX-PIIX-1996:~$ cat debug.0
Usage: ubuntu-core-launcher <security-tag> <binary>
fgimenez@fgimenez-Standard-PC-i440FX-PIIX-1996:~$ cat debug.unicorn
WARNING: unrecognized value of environment variable SNAP_CONFINE_DEBUG (expected yes/no or 1/0)
Usage: ubuntu-core-launcher <security-tag> <binary>. errmsg: Invalid argument

tags: added: verification-done
removed: verification-needed
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.