Mail Archives: cygwin/2011/03/07/08:42:56
X-Recipient: | archive-cygwin AT delorie DOT com
|
X-SWARE-Spam-Status: | No, hits=-1.2 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL
|
X-Spam-Check-By: | sourceware.org
|
MIME-Version: | 1.0
|
In-Reply-To: | <20091201091515.GC30043@calimero.vinschen.de>
|
References: | <4B14573C DOT 3040409 AT alice DOT it> <a13b5a590911301753w74ccf298g669e55fc58d36c50 AT mail DOT gmail DOT com> <20091201091515 DOT GC30043 AT calimero DOT vinschen DOT de>
|
Date: | Mon, 7 Mar 2011 13:42:40 +0000
|
Message-ID: | <AANLkTimtUQV5LCymquHFe115JL4S9Ld-GUgdLJbetan8@mail.gmail.com>
|
Subject: | Re: Unset TMP/TEMP in profile? (was Re: [ANNOUNCEMENT] [1.7] Updated: cygwin-1.7.0-67)
|
From: | Andy Koppe <andy DOT koppe AT gmail DOT com>
|
To: | cygwin AT cygwin DOT com
|
X-IsSubscribed: | yes
|
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm
|
List-Id: | <cygwin.cygwin.com>
|
List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
|
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com>
|
List-Archive: | <http://sourceware.org/ml/cygwin/>
|
List-Post: | <mailto:cygwin AT cygwin DOT com>
|
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
|
Sender: | cygwin-owner AT cygwin DOT com
|
Mail-Followup-To: | cygwin AT cygwin DOT com
|
Delivered-To: | mailing list cygwin AT cygwin DOT com
|
On 1 December 2009 09:15, Corinna Vinschen wrote:
> On Nov 30 20:53, Robert Pendell wrote:
>> On Mon, Nov 30, 2009 at 6:37 PM, Angelo Graziosi wrote:
>> > Robert Pendell wrote:
>> >>
>> >> P.S. - On linux (when I tested) TEMP, TMP, and TMPDIR were not set and
>> >> patch defaulted to /tmp.
>> >
>> > I noticed that too...
>> >
>> > Ken Brown wrote:
>> >>
>> >> That's precisely why I suggested unsetting TEMP and TMP in /etc/profi=
le.
>> >> Then things should work as in linux.
>> >
>> > Indeed. But a question emerges: what does it happen if one starts a Wi=
ndows
>> > application, which needs TEMP or TMP, from Cygwin?
>> >
>> > For example, GSview (*) can view ps.bz2 or pdf.bz2 files uncompressing=
them
>> > into $TEMP, so it fails if TEMP is not defined, and
>> >
>> > $ gsview foo.pdf.bz2
>> >
>> > is broken!
>> >
>> > This is only an example of problems which can emerge unsetting TEMP.
>> >
>> > Ciao,
>> > Angelo.
>> >
>>
>> Actually I had thought about that and I found that if you
>> intentionally unset all the variables it defaults back to the system
>> defined one which is dependent on the current user in Windows.
>> Basically what TEMP and TMP is defined to in Windows itself. =C2=A0This =
is
>> like the behavior in Linux.
>
> I'm wondering if /etc/profile is actually the right place for unsetting
> TMP and TEMP. =C2=A0What about etc/defaults/etc/skel/.bashrc instead? =C2=
=A0It
> allows every user simple access to the setting of TMP and TEMP and it
> could be seasoned with a user-visible comment.
Reheating this old thread because the proposed base-files 4.0 makes a
change here.
In the current 3.9-3, TEMP and TMP are unset in ~/.bashrc, as
suggested here by Corinna. Thing is, ~/.bashrc is only sourced for
non-login shells, yet the default console/mintty/rxvt shortcuts all
invoke bash as a login shell. In other words, this change might as
well not have been made as far as the vast majority of users are
concerned.
Now in base-files 4.0, TEMP and TMP are unset in /etc/profile instead,
which is sourced by login shells (but not by non-login shells). I
think this is a problem.
Some (badly written) Windows programs expect TEMP and/or TMP to always
be set to a valid directory and will misbehave when they aren't. But
even those that are written properly by using the Windows
GetTempPath() function will not behave well. That's because
GetTempPath() falls back to "the path specified by the USERPROFILE
environment variable", and not the original temp directory (i.e.
%USERPROFILE%/Local Settings/Temp or some such). This mean that
temporary rubbish will end up in the user's home directory, and if
they're unlucky, stuff might even get overwritten.
Unsetting TMP and TEMP was supposed to address an issue where 'patch'
picks up unwelcome ACLs from the temp directory. However, since no-one
has complained about this even though the fix wasn't actually
effective, and because the cure is worse than the disease, I think TMP
and TEMP should not be unset by default.
Andy
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -