From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 1D2D71F463 for ; Mon, 25 Nov 2019 05:42:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725747AbfKYFmH (ORCPT ); Mon, 25 Nov 2019 00:42:07 -0500 Received: from pb-smtp2.pobox.com ([64.147.108.71]:54918 "EHLO pb-smtp2.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725468AbfKYFmH (ORCPT ); Mon, 25 Nov 2019 00:42:07 -0500 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 2BD872CCAC; Mon, 25 Nov 2019 00:42:05 -0500 (EST) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=aBJxbua28F/GxR4Xbw3LgH4SlVA=; b=Fmco7K tiPYluawGFzMrGkf5JEb3FMXDnLwjkBKSzNt1MAjxFCwzTmgXQcJmk+04olkKA2e EJDLse3wlVKYBRboqDqCMl/F0biM1P5MLK2b6eSXZWFfcWKOZre9jeNP+VfsyHKH bLPY++HTGORqVkIz4+SdAM4xgH91YWy374c7U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=rKTpiICCEL8HzfpLaUonBJ6LHlZj6EHQ tOLoAi21eMvOQmegR8JLPiECl3sqIJ1gCznufKxx6BkkjA0WYcVz26aheWWlJSF3 K5ZjiTXHQ7v2ha4xiyPSEvqKctdxVMVXApp0yc04XrEJUat+VjhVf9nDFLPAqdVn QIpNkT/pjQk= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id D00152CCAB; Mon, 25 Nov 2019 00:42:04 -0500 (EST) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.76.80.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id DEC2C2CCAA; Mon, 25 Nov 2019 00:42:03 -0500 (EST) (envelope-from junio@pobox.com) From: Junio C Hamano To: "Johannes Schindelin via GitGitGadget" Cc: git@vger.kernel.org, Johannes Schindelin Subject: Re: [PATCH 0/4] On Windows, limit which file handles are inherited by spawned child processes References: Date: Mon, 25 Nov 2019 14:42:02 +0900 In-Reply-To: (Johannes Schindelin via GitGitGadget's message of "Fri, 22 Nov 2019 14:41:01 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 4F361C7C-0F46-11EA-8EC0-D1361DBA3BAF-77302942!pb-smtp2.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org "Johannes Schindelin via GitGitGadget" writes: > The problem to be solved: files cannot be deleted on Windows when even one > process has an open file handle to it. So when a process opens a temporary > file, then spawns a child process that inherits that file handle by mistake, > and then the parent process tries to delete the temporary file while the > child process is still running, the deletion will fail. (This description is > slightly simplified, see the commit message "spawned processes need to > inherit only standard handles" for more detail.) Makes me wonder if we should be marking these fds with FD_CLOEXEC to solve the issue in a way that is platform agnostic. It may turn out that we'd be better off to make it an explicit choice by the parent when it leaves a FD open while spawning a child process (and by that spawned child when it runs another executable---but I undertand that it is a single-step operation, not a two-step one, on Windows). In any case, synchronizing the differences in compat/ between our trees is good. Queued.