From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17701 invoked from network); 9 Oct 2020 21:28:01 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 9 Oct 2020 21:28:01 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1602278881; b=Dw7hhGZlaDQLFc9Aj/a7J9G/eERSOdrBiNhRFDo+cpxT2GajmUpW5Kit6dpzm/HZtyJfZo/1sM xfUGOMG9E7BGn0EKR7YRSmm4UkX9Fj0t5rJ1tDz++kAtJcOV+6X9goEwEdhME6jJnJL/ViQzbM xhck9QVorxvMyBn3MvkoC4/VLMP/JiXzFwo1tToXIFqjMamdKW4WK9OWo8JQcYgIRnEF0HY/Rm jkJ0O9KTYh7MC3vjnQZi5ljWNsM1ZxMPmsrLtFUomtQX2eCTwfDzDbi9XAgNeZjsXjKUXOTYt/ fz50sumc2R/Bq611MEcWiU992kczOwo1WXVKl8nhSHP7Lg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ot1-f45.google.com) smtp.remote-ip=209.85.210.45; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1602278881; bh=y3RBbwM8uGvbYqNVFUfG5raBr5I5ijXhUm4M3W1sOck=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=JwjjSkDuNwU0rW6DauCGQ7A253ugHjjsGklU43YY16AwaxQIAVl4ep09owR7M+HO3V9whJ5j3R Pyu/UyEQHsgfnOrakrz75iT9vucchznVb+RRQCbN6psy48u4eycoeyGMbB32Ft7sj5kMoQxYFB idu/H4NFaIP7qRkvjGmGyri279jdDm79f5xTm2uTYTcfYIle0nuM2BP6kDcKMhGJhRIv29VkSV p12ruh7HrNT98ElPFwF/+LhjqVdvW9z9mrbP3Y20Zx97BlVN52qZRVCWzxFoPsSkZ1KcZ7WHQH 5fHEN1WnRcZyQM2RLeR1fO5Q6U7Tf+pWNzu2kQ/Fby0UKg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Z+8frN7O18JDVoBG+EVTrgyWhbSYfzZEnbqZbCrWfp4=; b=XSKZNNK6WhnNELRBE2hOqH1Wjo NV0dnMIxD2zoq7R/0sQwWE9dFNj9Ru3Vwn1VSIjh1zNzA+tQlRwgrj2ZiniEZBQ1Dw/Nj+K4MdtlN DZMv/y2EVZs4CZx6RHNFTU2BQBzBRA0TwqpeS39smpsjQ+m3uSmoIOvkyfiPRGKVLDM48EvDPWfPT wCE2AKubaKjsPWNig1PT20piqSlu2oZFSc25qUDj2fAA1voYaZECABAXmfxAapqZeicGP3nHNp1ha V1Piw8PhcwcgHYgk/XkuAtt4KyEBy98mBC4tQ0rcCGG5K7oeurg1QfkxidAbZ/DwBeyET0pd8/cp2 uMlDgyKw==; Received: from authenticated user by zero.zsh.org with local id 1kQzvi-000KEG-JK; Fri, 09 Oct 2020 21:27:58 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ot1-f45.google.com) smtp.remote-ip=209.85.210.45; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ot1-f45.google.com ([209.85.210.45]:34263) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kQzvX-000K56-Hh; Fri, 09 Oct 2020 21:27:48 +0000 Received: by mail-ot1-f45.google.com with SMTP id d28so10319146ote.1 for ; Fri, 09 Oct 2020 14:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Z+8frN7O18JDVoBG+EVTrgyWhbSYfzZEnbqZbCrWfp4=; b=uLNksdem612GXpOEhm88xxjczRfmGf8PCK3eMtyNRqUSsuObzxa5gmpj3ih1KRo3Gd zsUDsNYJ0Advc/It23iwtuVspv98+bBfDtn/kSOg7vb1Yi7xGhfCPV04QAqNK40mkMOE w9ooxI1iJIEvlt79WbXNU12TX4pRjd+EFkCy4pCTc/rt2Xh05uQizZGyrOuFteldwCHr fKOoKbunloL0vFzVJ2zLhl56SKIEMIEyGjdSEnyzU9tALUNaz8FQL4phWycB2QnoZvOA rDyap/ndhz8/7s+PiNoF+HszOqpCyyDhqnsG4TW8JrmL8JcPZ4MJdu0/qiTg36DFXeUd 5hnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Z+8frN7O18JDVoBG+EVTrgyWhbSYfzZEnbqZbCrWfp4=; b=ttEbIfcAX5aRoNnzbUHAkSQe5FZh95tq9EAaXJpGZXuVV5rb+2xEmKOSayXw1JW6y/ VUYEAiGe9a58VMLy0ZUnxa2SboPLfaER4KmqDngB9+QrMLXFTOY67EqDb82pBrWiiTHm STzc5Y57VKdQ/LrpAPxk2V64bup1k84lwgRPghLO+LdwzG9Xx5G4LzBx1DltU5IRMHg+ usakvEPaIYKhpkhlMJcI9fM6qD/z9MVfYMQqw/yM+H2cHEsofcjuacFQMQ3kFmK4Yn3i DLgUqJAnqAFCiVnBDDTqBLuHWb1bSRbJEacgbMf9nFctlvPeoCpICLmkmBp3VtqqRqtw l5tw== X-Gm-Message-State: AOAM531e4PbKpnMUGwAXrOiXuTel8VyPBxd6pHYNgaqm+rAEMEH8fQR6 LS0swmXZxCXgybJK8koo5Z+aNWBWLWTwWsU3PaTENA== X-Google-Smtp-Source: ABdhPJw8Ag8QTlAi4jrnbbm4fN7mikWtG55VoqBtEg+7QluGfIbA9BnpJbYr9KSbttD97sJFk0wQ6ayqFnaxHAwg0vU= X-Received: by 2002:a9d:470c:: with SMTP id a12mr3238411otf.161.1602278866190; Fri, 09 Oct 2020 14:27:46 -0700 (PDT) MIME-Version: 1.0 References: <20201009200737.GA78914@CptOrmolo.darkstar> <20201009205357.GA6449@CptOrmolo.darkstar> In-Reply-To: From: Bart Schaefer Date: Fri, 9 Oct 2020 14:27:35 -0700 Message-ID: Subject: Re: [patch] Avoid race in zf_mkdir To: Roman Perepelitsa Cc: Zsh hackers list Content-Type: multipart/alternative; boundary="000000000000a6a43e05b1439ed7" X-Seq: 47442 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: --000000000000a6a43e05b1439ed7 Content-Type: text/plain; charset="UTF-8" On Fri, Oct 9, 2020 at 2:22 PM Roman Perepelitsa < roman.perepelitsa@gmail.com> wrote: > Perhaps something like this? > That would potentially cover it, except for one thing. Back to an earlier message: > > In neither variation are we checking that the existing directory actually has the requested mode. > > POSIX says this is how it should be. The document linked by Matthew asserts that "mkdir -m mode" should behave "as if" chmod() is called after creating the directory. --000000000000a6a43e05b1439ed7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Oct 9, 2020 at 2:22 PM Roman Pere= pelitsa <roman.perepelits= a@gmail.com> wrote:
Perhaps something like this?

That would potentially cover it, except for one= thing.=C2=A0 Back to an earlier message:

> > In neither variation are we checking that th= e existing directory actually has the requested mode.
>
> POSIX says this is how it should be.

The document linked by Matthew asserts that "mkdir -m mode&quo= t; should behave "as if" chmod() is called after creating the dir= ectory.
--000000000000a6a43e05b1439ed7--