interfaces/builtin: quote apparmor label #1117

Merged
merged 1 commit into from May 4, 2016

Conversation

Projects
None yet
4 participants
Contributor

zyga commented May 3, 2016

This patch adds double quotes around the apparmor label. Testing
uncovered that we should do this to make apparmor_parser happy.

Signed-off-by: Zygmunt Krynicki zygmunt.krynicki@canonical.com

interfaces/builtin: quote apparmor label
This patch adds double quotes around the apparmor label. Testing
uncovered that we should do this to make apparmor_parser happy.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
@@ -36,7 +36,7 @@ import (
// - "snap.$snap.*" if all apps are bound to the slot
func slotAppLabelExpr(slot *interfaces.Slot) []byte {
var buf bytes.Buffer
- fmt.Fprintf(&buf, "snap.%s.", slot.Snap.Name())
+ fmt.Fprintf(&buf, `"snap.%s.`, slot.Snap.Name())
@mvo5

mvo5 May 3, 2016

Collaborator

Is there a closing " missing here?

@zyga

zyga May 3, 2016

Contributor

The closing one is added at the end (of the function)

@mvo5

mvo5 May 3, 2016

Collaborator

Aha! Thanks.

Collaborator

mvo5 commented May 3, 2016

Looks good - but I wonder if we should have a test for slotAppLabelExpr() if the " is missing here.

Contributor

zyga commented May 3, 2016

Yeah, I'll add a test that ensures we don't forget the trailing "

Contributor

jdstrand commented May 3, 2016

LGTM, thanks!

@niemeyer niemeyer merged commit 348896d into snapcore:master May 4, 2016

4 checks passed

Integration tests Success
Details
autopkgtest Success
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.002%) to 79.341%
Details

@zyga zyga deleted the zyga:fix-aa-label branch Dec 12, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment