X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ECCFC398C008
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1600359219;
	bh=VdT5FzAyhlUOXv2wVUYPbWRbdrMgmvDvhsk4Y0ts+CM=;
	h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
	 From;
	b=DChkNezFJpvuoMPE4SNj2b+GiaaBB5xLkHWrK4mQ4pjPKffP32/dtmFxRAPMaQc/O
	 aLSQLPTdhlxYAMHFxwuzzdclHUDJuxC+zAAGGgOA+xwd7GBMRfTptimtbkURzEj591
	 uUli6BZM1T/4qBmLVYXAjpA+BPWx8R6DghI9SR0s=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5F4B0398C004
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=atXWSxfL2bnBNh7GCNBeNm72q8FI1RPJEZERVgQNfO7SE57fgTPgQ9uT671/fozN2nDyJSf3KHsfL6uWkgE7A05kjeCNh9UcxaP0o0wjz+cQiKuWfi28DPUlM5seAP28n8jhuMEQZ6ZHgnL73c7H9cSl49e/zjkE51Irt9HkR28NnsXkTYPkKESEasyVrxeMevp2o8nbDNbKbNNkWtDTiyjxyJgr0vsuvNXNGzGPzkHvHzaG4UIZsUdxubxebUYFI6fQEl78F47FHH3UMaH5r2GYubVwHBVa+8EHklHsDAjirjZChhDcaBoHnzVF4A5Wr9UTOxw+CMSnCUz8qkLGrA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=zTvf6uy6GfjYxZTyCor+pVePPTUF1P4Ba9mLyKkyqwU=;
 b=D5ibLfUHkKcmKbrMK06Ql3SShCBbqG3LYioiC93ImBFOXdNZEgNvn+3u1MLHYF7rByC3vuA0/EtwLKpM0UZ2jXZW+K4KUTRVSxgYnwViEV9GybF9Sv+Sr/0w3PNFDmUBjcFfMRIXI3ptbdjZ5HdUBvl8px39rv/r8sN2soQVPU0PW/5nXGdu1chOaNV/wG08R1tdtyUDlAJP+j2qU4L+XYgxAe4WwmilzOOC89XQChRD1wj+zUj50N1WlCLmPHnZS2hZEcsyhcZglCt3FukjR5gK+54DcMmDDEqt8RlBv3gwfztMJAUZQjq8nkbRltSw2X2E9cBXPoDypGKtGildJw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu;
 dkim=pass header.d=cornell.edu; arc=none
Subject: Re: TMP/TEMP environment variable and /tmp
To: cygwin@cygwin.com
References: <025401d68c06$9a89e8b0$cf9dba10$@gmail.com>
 <CAB8Xom9qowtQ+Jq1Z4tOxCHrVAugNyQ7UpVT3gXm1yJ9yj=bfg@mail.gmail.com>
 <202459f2-75cc-1ac2-7953-67f98e6fdb35@towo.net>
Message-ID: <048fba34-bf57-4497-b726-34d2b7691cd8@cornell.edu>
Date: Thu, 17 Sep 2020 12:13:31 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
 Thunderbird/68.12.0
In-Reply-To: <202459f2-75cc-1ac2-7953-67f98e6fdb35@towo.net>
Content-Language: en-US
X-ClientProxiedBy: MN2PR02CA0013.namprd02.prod.outlook.com
 (2603:10b6:208:fc::26) To MN2PR04MB6176.namprd04.prod.outlook.com
 (2603:10b6:208:e3::13)
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
Received: from [192.168.0.17] (68.175.129.7) by
 MN2PR02CA0013.namprd02.prod.outlook.com (2603:10b6:208:fc::26) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.3391.11 via Frontend Transport; Thu, 17 Sep 2020 16:13:32 +0000
X-Originating-IP: [68.175.129.7]
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 41fb6b2f-03f8-478d-cef8-08d85b249fae
X-MS-TrafficTypeDiagnostic: MN2PR04MB5568:
X-Microsoft-Antispam-PRVS: <MN2PR04MB5568D2852A2369A2DE9D1386D83E0@MN2PR04MB5568.namprd04.prod.outlook.com>
X-MS-Oob-TLC-OOBClassifiers: OLM:4303;
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: 0xJjal2lH7l3o+a99jI00oKISEM2t/3dJjnap1CkczWyKvc/w4czkXUe4V1qnHiE+0nIy0nUE8ORpax6QgBxia/W+hMuexs+WyOfYgrOCoiBEjhW14OaZlO6GB1tuDbkL0Dv1hYfTPGLW+N8YxqIWZ1vtiezoPWkxe8bLDGX+u7xkrOt8E9USWCM6yidAmli9AbtnFUU4HKKfM216UemIUTaed2Kk4tDPrV/9qZpUTgCgWwcrDCjeWxJ66VmqBXILzNFkTRgUefsNZCMRPJnAuMs8uArTOPfdHdnI13I6UuF9ZIWmZsi0WuzQ0ln+02S3iyQvZLTP/ho99XjacENWw1ZecFgxDQubeVGwgM8ptTl7g4B+yWO8ENMB2y7jbJzg7gBAj1Q0AMybX3OMBCcZlA5EJzpmBThu/OJoF6oCYMPmhxQEGqDhiPmb/YSkVefyLAi97kc896RAVKxHmZrSXXvrIAoPZCh8Q1RitxHPfvFwJPuyqJgP16+GidoLtwH
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:MN2PR04MB6176.namprd04.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(4636009)(396003)(366004)(39860400002)(376002)(136003)(346002)(316002)(16576012)(6916009)(956004)(31696002)(8676002)(2616005)(75432002)(966005)(5660300002)(66556008)(786003)(478600001)(66476007)(66946007)(52116002)(86362001)(83380400001)(31686004)(53546011)(2906002)(26005)(36756003)(8936002)(186003)(6486002)(16526019)(43740500002);
 DIR:OUT; SFP:1102; 
X-MS-Exchange-AntiSpam-MessageData: DElChoG4ZmSVZ0I9OmZR9dIxaQdWjxO883XT7MJHP4+E4B/bwUAB5dRV/99hqD7DlFtg1szrJEnN8DH3h08W6K4i3f0J1+ttyA5x/wWDybCbLKxjOtOOvE5ruMQf6fezbUf8kjNTijaiYlUG8ZV0I7enZEz5S5vc7fCT5LeWhJ5q9wnoscbQt5A8TGykxX+6b2LjG2DHKIyUAAp2sxUOvKpWu3gRCx/gP9FidVfNFaCGt/Nx/DKH0qYiyrEPWfBemWyGEbDfRZ9ip08O8FafeG6vC4dVldNNx1cCj01MKMXHZuDjq2a9DzAK/celFu8Fxjnjc3l2dwpDIIsD6XeIXDoZY8y3XGgtxjxefGhA6tydwF4ObMRBmAjZLxDzopCmm94HrWl3BWcIyBOliCG5xxrNMM+pGp9ry0GwckJ8End6/vfQzSlHDsKo551VOdl6AuAz3672tm0+KI+WyvxDPsZXEfj7LZqaIecTrhaU6KnCjVZAttf4/sZI3sShgP35bt/ezKJ4ah/wYqTcWvb0fJRpE24+RPqwXsS6lsEc6Fv2iNEmT+utHxXEH71sK6t/7EbyI2hXlSA1PyEoGWw3hHIaZ9YwbHFb25i9evwc6+fBLGQRf1N69IcHj5bB3KSMFe39GdpzdLK9gGmuAN227Q==
X-OriginatorOrg: cornell.edu
X-MS-Exchange-CrossTenant-Network-Message-Id: 41fb6b2f-03f8-478d-cef8-08d85b249fae
X-MS-Exchange-CrossTenant-AuthSource: MN2PR04MB6176.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2020 16:13:33.2017 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 6uNOwOzIPDXpqAXZce5rHlyjkn4UpdMEAjfNbPSkHnS5TauZbR+fd5JcfAeLOTk+lHkK2RTnt1WfCyo/knNHHg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB5568
X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, DKIM_INVALID,
 DKIM_SIGNED, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, NICE_REPLY_A,
 RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS,
 TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Ken Brown via Cygwin <cygwin@cygwin.com>
Reply-To: Ken Brown <kbrown@cornell.edu>
Content-Type: text/plain; charset="windows-1252"; Format="flowed"
Errors-To: cygwin-bounces@cygwin.com
Sender: "Cygwin" <cygwin-bounces@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 08HGE3Vo029555

On 9/16/2020 7:12 AM, Thomas Wolff wrote:
> Am 16.09.2020 um 13:04 schrieb marco atzeri via Cygwin:
>> On Wed, Sep 16, 2020 at 10:53 AM Kristian Ivarsson via Cygwin
>> <cygwin@cygwin.com> wrote:
>>> Dear folks
>>>
>>> Does anyone know why cygwin annex the TMP (and TEMP) environment variable(s)
>>> and sets them to /tmp for cygwin-built-applications (executables) ?
>>>
>>> This results in that when you want the current users TMP-folder you end up
>>> with the /tmp path. As a result,when writing to that, without having cygwin
>>> installed (e.g. C:\cygwin64\), it seems like it refers to ${CWD}/../tmp/ and
>>> that is not always accessible by all users
>>>
>>>
>>> Does anyone know the rational with this behaviour and what can be done to
>>> get hold of the (real) Windows TMP/TEMP environment-variable-values (in a
>>> (hopefully) platform independent way) ?
>>>
>>>
>>> Best regards,
>>> Kristian
>>>
>> the logic behind is that the program should be located
>> in
>>      $YOUR_ROOT/bin
>>
>> and the temp will be
>>      $YOUR_ROOT/tmp
>>
>> so if you are making your custom tree, try to stick on that expectation
>> and have both directories.
> In general, you are free to set TMP to a directory of your choice, that's the 
> purpose of that variable, no need to sync it with some root.
> There is a comment in /etc/profile:
>    # TMP and TEMP as defined in the Windows environment
>    # can have unexpected consequences for cygwin apps,
> but it does not explain what consequences that might be; probably some trouble 
> with ACL/access permissions for temporary files.

That's right.  There was an issue in 2009 in which 'patch' was unexpectedly 
changing permissions.  See the long thread starting at

   https://cygwin.com/pipermail/cygwin/2009-November/181760.html

and continuing at

   https://sourceware.org/pipermail/cygwin/2009-December/181829.html

The problem was caused by the inheritable permissions on a temporary directory 
that patch was using, based on the value of the Windows TMP environment variable.

Ken
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

