Merge ~xnox/launchpad-buildd:image-targets-fix into launchpad-buildd:master
Proposed by
Dimitri John Ledkov
Status: | Rejected |
---|---|
Rejected by: | Colin Watson |
Proposed branch: | ~xnox/launchpad-buildd:image-targets-fix |
Merge into: | launchpad-buildd:master |
Diff against target: |
35 lines (+21/-3) 1 file modified
lpbuildd/target/chroot.py (+21/-3) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson (community) | Disapprove | ||
Review via email: mp+386328@code.launchpad.net |
Commit message
target/chroot: fix passing space separate env variable values
To post a comment you must log in.
You've misunderstood what lpbuildd/ target/ lxd.py is doing here. It has to quote arguments in the case where cwd is not None because it's explicitly constructing a shell command line. The rule is that there must be exactly one layer of quoting per layer of parsing, so because the shell invocation adds another layer of parsing, it has to add another layer of quoting to match. The lxd backend is correct.
The problem here is that the call to shell_escape in the lines you're modifying is flat-out wrong (which seems to have been my fault). There is no parsing involved here: args is being constructed as an argument list rather than something that's passed to a shell, and adding extra quoting to those is incorrect. The correct fix would be simply to remove the call to shell_escape on line 65. Could you please do that instead? It doesn't need a comment - it just needs to have the incorrect function call removed.
It would also be helpful to add a test for this, which could go alongside the other test_run* methods in lpbuildd/ target/ tests/test_ chroot. py.