Merge lp://qastaging/~mterry/snap-confine/tmpdir-15.04 into lp://qastaging/snap-confine/15.04

Proposed by Michael Terry
Status: Merged
Approved by: John Lenton
Approved revision: 66
Merged at revision: 65
Proposed branch: lp://qastaging/~mterry/snap-confine/tmpdir-15.04
Merge into: lp://qastaging/snap-confine/15.04
Diff against target: 113 lines (+55/-10)
3 files modified
Makefile (+2/-0)
src/main.c (+19/-10)
tests/test_tmpdir (+34/-0)
To merge this branch: bzr merge lp://qastaging/~mterry/snap-confine/tmpdir-15.04
Reviewer Review Type Date Requested Status
John Lenton (community) Approve
Review via email: mp+261104@code.qastaging.launchpad.net

Commit message

Fix propagation of TMPDIR from the launcher to the command being run.

This is a backport of r67 and r68 from trunk.

Description of the change

Fix propagation of TMPDIR from the launcher to the command being run.

Our logic for making sure that TMPDIR exists iterated over the return value of getenv("TMPDIR") with strtok. But strtok modifies its argument. And getenv returns the real environment memory used, so modifications there actually change your environment.

The end result is that we were emptying TMPDIR while making it.

I've also fixed a bug that caused us to stop trying to make TMPDIR if any piece of it (above /tmp) already existed (like, /tmp/snaps/!).

And of course, a test.

This is a backport of r67 and r68 from trunk.

To post a comment you must log in.
Revision history for this message
John Lenton (chipaca) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches