TMPDIR is being lost for snap commands

Bug #1457183 reported by Michael Terry
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
snap-confine
Status tracked in Trunk
15.04
Fix Released
Undecided
Michael Terry
Trunk
Fix Released
Undecided
Michael Terry

Bug Description

In the wrapper scripts that get installed in /apps/bin, TMPDIR, TEMPDIR, and SNAP_APP_TMPDIR are all set to the same thing.

But in the eventual command that gets run, only TEMPDIR and SNAP_APP_TMPDIR still have that value. TMPDIR is empty and it shouldn't be.

Related branches

Revision history for this message
Michael Terry (mterry) wrote :

Here's a tiny shell snap to reproduce. It just echos the various temp variables.

affects: snappy → ubuntu-core-launcher
Revision history for this message
Michael Terry (mterry) wrote :

This appears to be because ubuntu-core-launcher runs strtok over the return value from getenv. strtok modifies the memory it is pointed at, and getenv returns the address in memory of the actual environment. Changing it, changes the environment.

Changed in ubuntu-core-launcher:
assignee: nobody → Michael Terry (mterry)
Michael Terry (mterry)
Changed in ubuntu-core-launcher:
status: New → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.