[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: TZ=... date affected PROMPT_COMMAND
From: |
jidanni |
Subject: |
Re: TZ=... date affected PROMPT_COMMAND |
Date: |
Thu, 17 Apr 2008 17:34:27 +0800 |
OK, now using Archimerged's cleaner version, I bet Matthew can
reproduce this.
root@jidanni1:/root# su - nobody
No directory, logging in with HOME=/
nobody@jidanni1:/$ PROMPT_COMMAND='prompt_status=\ $?'
nobody@jidanni1:/$ PS1=$SPECIAL_PS1"\A\${prompt_status# 0} \W$ "
17:26 /$ TZ=America/Los_Angeles date
Thu Apr 17 02:26:11 PDT 2008
02:26 /$ echo $BASH_VERSION
3.1.17(1)-release
02:26 /$ false
02:26 1 /$ true
02:26 /$ /bin/true
17:26 /$
Note how the prompt timezone becomes contaminated until we finally
shake it back off with a non-built-in command.
You know, this reminds me of some injection attacks!