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_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 9A9D720248 for ; Thu, 18 Apr 2019 14:47:41 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; q=dns; s=default; b=xQ1/4 zYy8yT2+HsxCkYyt0ymH6aY3gnTpOG/KH1XgFgr5f+6YGmZLHh7zHQTGGGp+UccQ P9oYrm7t1OuQRh00Vgro8oweSgNI6Ir+6wyoc6qQgsXjepEr1BEj+nOd33s8iZjl ToXbJMDp5d/32/dU8VYio57SJuLBVq2lL/BFr8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; s=default; bh=Klbt5GewH8I DceZcS88pzreWVYA=; b=s1y/HHlErUNmAfXh7bOyL7MxVDRFkmbJvtI439f5lgV 6d/6YErUw+aU43cwALdVWShrFADbLuQ4vqErJUGr7a3vlgIETCystrUCc/MDv+RN tNzfp0qgUWrLF+ftFsSEOKT4l6Qq/cwdhenNVlK0TdL8G29SFJGyODCLyVEUSr6Y = Received: (qmail 91821 invoked by alias); 18 Apr 2019 14:47:39 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 91812 invoked by uid 89); 18 Apr 2019 14:47:39 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mx1.redhat.com From: Florian Weimer To: Andreas Schwab Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] Avoid concurrency problem in ldconfig (bug 23973) References: <87bm13y11o.fsf@oldenburg2.str.redhat.com> Date: Thu, 18 Apr 2019 16:47:34 +0200 In-Reply-To: (Andreas Schwab's message of "Thu, 18 Apr 2019 14:59:46 +0200") Message-ID: <87zhonv08p.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain * Andreas Schwab: > On Apr 18 2019, Florian Weimer wrote: > >> * Andreas Schwab: >> >>> Use a unique name for the temporary file when updating the ld.so cache, so >>> that two concurrent runs of ldconfig don't write to the same file. >>> >>> * elf/cache.c (save_cache): Use unique temporary name. >>> (save_aux_cache): Likewise. >> >> The downside of this change is that if ldconfig is interrupted, the >> temporary file never goes away. >> >> Ideally, we would use O_TMPFILE if supported by the (file) system, but >> that can get quite involved. > > That shortens the window, but won't close it, since we need a name to > pass to rename in any case. The difference is that with a fixed name, the next ldconfig run will use the same name and rename, cleaning up. With a random, unique name, that automatic cleanup is gone. Thanks, Florian