Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14736

RE: Environment variable "PS4" can not be passed to bash script from version 4.2.46(2)

Path csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From "Chen, Farrah" <farrah.chen@intel.com>
Newsgroups gnu.bash.bug
Subject RE: Environment variable "PS4" can not be passed to bash script from version 4.2.46(2)
Date Wed, 24 Oct 2018 04:29:46 +0000
Lines 20
Approved bug-bash@gnu.org
Message-ID <mailman.2648.1540355406.1284.bug-bash@gnu.org> (permalink)
References <1B925CC0CD9F3341B32D442251E7E1DC392DBFC8@shsmsx102.ccr.corp.intel.com> <20181023160606.wmiv3sneb5vhp6hr@eeg.ccf.org> <a95a6524-f8af-e659-7e61-4561477add8a@case.edu>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset="utf-8"
Content-Transfer-Encoding base64
X-Trace usenet.stanford.edu 1540355406 17896 208.118.235.17 (24 Oct 2018 04:30:06 GMT)
X-Complaints-To action@cs.stanford.edu
Cc "bug-bash@gnu.org" <bug-bash@gnu.org>
To "chet.ramey@case.edu" <chet.ramey@case.edu>, "wooledg@eeg.ccf.org" <wooledg@eeg.ccf.org>
Envelope-to bug-bash@gnu.org
X-Amp-Result SKIPPED(no attachment in message)
X-Amp-File-Uploaded False
X-ExtLoop1 1
X-IronPort-AV E=Sophos;i="5.54,418,1534834800"; d="scan'208";a="102776655"
Thread-Topic Environment variable "PS4" can not be passed to bash script from version 4.2.46(2)
Thread-Index AdRq3w9sHa2wWnCqS0C6/Wmnksx+SP//kGAAgABOtQD//voLsA==
In-Reply-To <a95a6524-f8af-e659-7e61-4561477add8a@case.edu>
Accept-Language en-US
Content-Language en-US
X-MS-Has-Attach
X-MS-TNEF-Correlator
dlp-product dlpe-windows
dlp-version 11.0.400.15
dlp-reaction no-action
x-titus-metadata-40 eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODcwZDAxNGUtMTE4Yi00ZDYyLWJiMDgtYzkyNmU0MGMzMjcyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiT3lKM2h5bW5HZ045OGt1a0ZuWmVMcjRWSURwaGtZUzNtTEhaV2xOWDhzSFQyVVwvMzZkYXhqdEFjR1R3R1V0dVkifQ==
x-ctpclassification CTP_NT
x-originating-ip [10.239.127.40]
X-detected-operating-system by eggs.gnu.org: Genre and OS details not recognized.
X-Received-From 134.134.136.20
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.21
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash/>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:14736

Show key headers only | View raw


Got it, thanks for the info.


Thanks,
Fan



-----Original Message-----
From: Chet Ramey [mailto:chet.ramey@case.edu] 
Sent: Wednesday, October 24, 2018 4:48 AM
To: Chen, Farrah <farrah.chen@intel.com>; bug-bash@gnu.org
Cc: chet.ramey@case.edu
Subject: Re: Environment variable "PS4" can not be passed to bash script from version 4.2.46(2)

On 10/23/18 12:06 PM, Greg Wooledge wrote:
> On Tue, Oct 23, 2018 at 03:20:12PM +0000, Chen, Farrah wrote:
>> But in Bash script, it cannot work, it keeps its original value:
>> [root@fchen ~]# cat test.sh
>> #!/usr/bin/bash
>> echo $PS4
>> echo $FAN
> 
> This is because you're doing it as root.  Bash strips PS4 from the 
> environment when started as root, as a security precaution.

That change came in in bash-4.3 (patch 48). His vendor probably patched their version of bash-4.2 to do the same thing.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

RE: Environment variable "PS4" can not be passed to bash script from version 4.2.46(2) "Chen, Farrah" <farrah.chen@intel.com> - 2018-10-24 04:29 +0000

csiph-web