Merge lp://qastaging/~mterry/snap-confine/tmpdir into lp://qastaging/~snappy-dev/snap-confine/trunk

Proposed by Michael Terry
Status: Merged
Approved by: John Lenton
Approved revision: 70
Merged at revision: 68
Proposed branch: lp://qastaging/~mterry/snap-confine/tmpdir
Merge into: lp://qastaging/~snappy-dev/snap-confine/trunk
Prerequisite: lp://qastaging/~mterry/snap-confine/fix-tests
Diff against target: 71 lines (+45/-2)
2 files modified
src/main.c (+11/-2)
tests/test_tmpdir (+34/-0)
To merge this branch: bzr merge lp://qastaging/~mterry/snap-confine/tmpdir
Reviewer Review Type Date Requested Status
John Lenton (community) Approve
Review via email: mp+260620@code.qastaging.launchpad.net

Commit message

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

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.

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

Check return of strdup, add comment about why we do it

70. By Michael Terry

Make it die instead of just returning

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