TMPDIR is being lost for snap commands

Bug #1457183 reported by Michael Terry on 2015-05-20
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
snap-confine
Status tracked in Trunk
15.04
Undecided
Michael Terry
Trunk
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

Michael Terry (mterry) wrote :

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

affects: snappy → ubuntu-core-launcher
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) on 2015-06-01
Changed in ubuntu-core-launcher:
status: New → In Progress
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers