Skip to content

Commit

Permalink
Only perform Verify in the same context as Run
Browse files Browse the repository at this point in the history
Before this patch, verify is run twice when using fakemachine,
once as a normal user on the host, and then again as root on the
fakemachine. The issue is that a normal user may not be able to
invoke all the commands (e.g. just due to paths) that a superuser
can. In particular, debian installs debootstrap under /usr/sbin.
  • Loading branch information
eds-collabora committed Aug 14, 2021
1 parent 420dce9 commit fce1e07
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmd/debos/debos.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,12 @@ func main() {
}
}

for _, a := range r.Actions {
err = a.Verify(&context)
if exitcode = checkError(&context, err, a, "Verify"); exitcode != 0 {
return
if !runInFakeMachine {
for _, a := range r.Actions {
err = a.Verify(&context)
if exitcode = checkError(&context, err, a, "Verify"); exitcode != 0 {
return
}
}
}

Expand Down

0 comments on commit fce1e07

Please sign in to comment.