From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 7af279c5 for ; Thu, 28 Mar 2019 15:42:31 +0000 (UTC) Received: (qmail 24914 invoked by alias); 28 Mar 2019 15:42:20 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44194 Received: (qmail 2699 invoked by uid 1010); 28 Mar 2019 15:42:20 -0000 X-Qmail-Scanner-Diagnostics: from heimdall.zentaur.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.1/25398. spamassassin: 3.4.2. Clear:RC:0(45.56.127.49):SA:0(-2.0/5.0):. Processed in 0.861765 secs); 28 Mar 2019 15:42:20 -0000 X-Envelope-From: cdb_zsh@zentaur.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at zentaur.org designates 45.56.127.49 as permitted sender) DKIM-Filter: OpenDKIM Filter v2.11.0 heimdall.zentaur.org x2SFfiue014123 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zentaur.org; s=default; t=1553787704; bh=U9CvAk7h75n6MWR7ZzETN1t5R6ix6cRzvoabjyIVNeY=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=F7tV+fTs5QtbLHKilYGtkipVhYKSP2X7tPsRcMRVMzAC9tv20eoOsJrkA4PNRlTxC 7GXm0bZ5AU3xJxmad2q/k0VEDJuNmHUv5OAtcjB2+hKgTGPA84ZyobGOvzNcHp1bHp 8bjzNtWov55O7/VrJM4U1zFxzO4RYqPpqyqg0Ubg= Subject: Re: [RFC] adding zmktemp command To: Oliver Kiddle Cc: zsh-workers@zsh.org References: <71983-1553787379.577063@6_Yl.hHPA.g91O> From: Clinton Bunch Message-ID: <3e4f360f-9915-f7e0-56da-42562e64fa23@zentaur.org> Date: Thu, 28 Mar 2019 10:40:09 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <71983-1553787379.577063@6_Yl.hHPA.g91O> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US On 3/28/2019 10:36 AM, Oliver Kiddle wrote: > Clinton Bunch wrote: >> I'm thinking of adding a zmktemp command either in a new module (e.g. >> The advantage I can see to being it's own module, is it could be >> backported and separately packed for Long-Term Supported OS. (Mostly >> thinking of Enterprise Linux distributions) > I doubt you'd be able to persuade such distributions to include even a > completely new and separate module. > >> But it also seems like it would be a good fit into the zsh/files module >> (mktemp and zf_mktemp instead of zmktemp) > zsh/files would mostly make sense for a mktemp builtin that closely > follows the interface of the normal mktemp Unix utility. If the focus is > to provide a consistent and convenient way to create temporary files, > then following mktemp is perhaps not the best choice. For security > reasons, an interface that returns a file handle is, I think, generally > preferred these days. Perhaps sysopen (in zsh/system) could accept a -t > option instead of a filename. > > Oliver I was planning on adding a -f option to return a fd in a parameter.  The sysopen solution though wouldn't give you the filename which would mean you couldn't pass it to an external program.  I realize that that has some security issues which is why an unpredictable filename is needed.