Bug 16024 - chroot should clear TMPDIR environment variable
: chroot should clear TMPDIR environment variable
Status: CLOSED FIXED
: Sisyphus
(All bugs in Sisyphus/coreutils)
: unstable
: all Linux
: P2 normal
Assigned To:
:
:
:
:
:
  Show dependency tree
 
Reported: 2008-06-14 17:58 by
Modified: 2008-09-01 01:02 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-06-14 17:58:06
While performing rescue jobs in a chroot (changing rootfs type):

# mkinitrd --help
/sbin/mkinitrd: line 1557: cannot create temp file for here document: No such
file or directory

# set | grep T.*MP
TMP=/tmp/.private/root
TMPDIR=/tmp/.private/root
# ls /tmp/.private/root
ls: cannot access /tmp/.private/root: No such file or directory

Indeed.
------- Comment #1 From 2008-06-14 18:07:42 -------
(In reply to comment #0)
> While performing rescue jobs in a chroot (changing rootfs type):

This is not a regular operation, right?

> # mkinitrd --help
> /sbin/mkinitrd: line 1557: cannot create temp file for here document: No such file or directory
> 
> # set | grep T.*MP
> TMP=/tmp/.private/root
> TMPDIR=/tmp/.private/root
> # ls /tmp/.private/root
> ls: cannot access /tmp/.private/root: No such file or directory
> 
> Indeed.

There are many ways to fool yourself.
Try "env TMPDIR= chroot" next time.
------- Comment #2 From 2008-06-14 22:33:20 -------
(In reply to comment #1)
> > While performing rescue jobs in a chroot (changing rootfs type):
> This is not a regular operation, right?
It is one of operations when:
- the stress is usually above usual;
- weird diagnostics don't really help.

> > # mkinitrd --help
> > /sbin/mkinitrd: line 1557: cannot create temp file for here document: No such file or directory
> > ls: cannot access /tmp/.private/root: No such file or directory
> There are many ways to fool yourself.
> Try "env TMPDIR= chroot" next time.
I'll sure forget it 'till next time.

Rather wanted to draw your attention to the fact that corner cases like this do
matter; is it unreasonable to request that directory existence[/writability]
check be performed before setting TMP/TMPDIR?
------- Comment #3 From 2008-06-14 23:36:11 -------
Lets handle this issue in chroot(1).
------- Comment #4 From 2008-06-15 12:05:21 -------
Thanks in advance!
------- Comment #5 From 2008-08-30 03:26:54 -------
6.11-alt1-2-gc4aa447
------- Comment #6 From 2008-09-01 01:02:56 -------
Your advance has arrived :-)