Merge lp:~mvo/snappy/snappy-clickpkg-snappypkg-meh into lp:~snappy-dev/snappy/snappy-moved-to-github

Proposed by Michael Vogt
Status: Merged
Approved by: Sergio Schvezov
Approved revision: 549
Merged at revision: 550
Proposed branch: lp:~mvo/snappy/snappy-clickpkg-snappypkg-meh
Merge into: lp:~snappy-dev/snappy/snappy-moved-to-github
Diff against target: 39 lines (+15/-3)
1 file modified
cmd/snappy/cmd_internal_unpack.go (+15/-3)
To merge this branch: bzr merge lp:~mvo/snappy/snappy-clickpkg-snappypkg-meh
Reviewer Review Type Date Requested Status
Sergio Schvezov Approve
Review via email: mp+263681@code.launchpad.net

Commit message

Try both clickpkg and snappypkg when dropping privs.

Description of the change

Try both clickpkg and snappypkg when dropping privs.

To post a comment you must log in.
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

it seems like it is going to work

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

once this lands we need to push it to wily and tools-proposed

works like a charm for building 15.04 and rolling.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'cmd/snappy/cmd_internal_unpack.go'
--- cmd/snappy/cmd_internal_unpack.go 2015-06-26 12:56:53 +0000
+++ cmd/snappy/cmd_internal_unpack.go 2015-07-02 16:02:25 +0000
@@ -49,9 +49,11 @@
49// }49// }
50import "C"50import "C"
5151
52// for compat with the old snappy, once that is gone we can drop to a52// we keep supporting clickpkg for compat with older images
53// different user53var dropPrivsUsers = []string{
54const dropPrivsUser = "snappypkg"54 "snappypkg",
55 "clickpkg",
56}
5557
56type cmdInternalUnpack struct {58type cmdInternalUnpack struct {
57 Positional struct {59 Positional struct {
@@ -123,8 +125,18 @@
123 defer d.Close()125 defer d.Close()
124126
125 if helpers.ShouldDropPrivs() {127 if helpers.ShouldDropPrivs() {
128 var dropPrivsUser string
126129
130 // first find out what user to use
127 passFile := passwdFile(rootDir, "passwd")131 passFile := passwdFile(rootDir, "passwd")
132 for _, dropPrivsUser = range dropPrivsUsers {
133 _, err := readUID(dropPrivsUser, passFile)
134 if err == nil {
135 break
136 }
137 }
138
139 // then get uid/gid
128 uid, err := readUID(dropPrivsUser, passFile)140 uid, err := readUID(dropPrivsUser, passFile)
129 if err != nil {141 if err != nil {
130 return err142 return err
131143
=== renamed file 'cmd/snappy/cmd_low_level_unpack_test.go' => 'cmd/snappy/cmd_internal_unpack_test.go'

Subscribers

People subscribed via source and target branches