From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11200 invoked by alias); 13 Feb 2017 02:30:26 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22461 Received: (qmail 10221 invoked from network); 13 Feb 2017 02:30:26 -0000 X-Qmail-Scanner-Diagnostics: from mail-wm0-f49.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(74.125.82.49):SA:0(0.2/5.0):. Processed in 1.170889 secs); 13 Feb 2017 02:30:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: timothee.cour2@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 74.125.82.49 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+6tz71ncOeRTx8Dqaz8NabHowbmagd6XkoR1A6u2xjo=; b=YKsaxUgbAjstEi5l9H4oPbxFQjAies+ovC5pPHBqfphO04LSQPCSlkJxhUjPhcs/Vr 9B1tFInJJtLb1QUAw3RanP553KbVjCWn0qRrX8CI35E06ACINlIxmaclU83/xejTPTY9 rTHM17ppiFpY7VCIryKACkRcKBdNGBzhGgDo4IVvui7shDVaAevtcyW3dAuY4xFM524D +5HAhajD7AHQSNAZzVuB1A3+spoCqdwF0jN7GREbQafU+BG2s+gP6yMhkGAEhRstZvH6 ipQ4oQ+/qv40li7KPG9JCy+dQgrjNnSNhlAeu0epYHNpvX6IghZZSi74ijOi4cKyKq0/ h2fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+6tz71ncOeRTx8Dqaz8NabHowbmagd6XkoR1A6u2xjo=; b=dDBl5u0noH+fZe+ylnTbFVByz/eZk9TmPXVrSFGmKb96n5gaDBI6v4ZdUoW3P5Y06Z lLyTFKiDwOnEHpS47gBFHbXi6WMljIq2ZlY9JRThj9SWJQvLZMlX7i+jPW3p9+3UB+AM 0PMv1kF4htZXhCqnJPhhQENzAEDH12ZJPwfUYlzb4DpD/a+HxXCFJpXjkSBAYRrijBq8 Sswah+ygPCbt0Xl8DgJE9qdBnEkz+mRKDo/XIWe6LZhRIpRaGgdmuhT2mpzblF4iWkw7 qjxtvDNDQjc3YlnzK+PEd4fcY2VHFlPouXXRtZ04YVW0y9vlO2Arm4LHIwIFeJ7Ye4Bl /J2A== X-Gm-Message-State: AMke39m92jHnKBeiu78sGLc27W6DOw3gC75NloA4PMZvXQjgq4Ocwc+sAjmgsoGvRdkXH8SZ2gqG90kqaic+SQ== X-Received: by 10.28.35.142 with SMTP id j136mr33997035wmj.11.1486953017474; Sun, 12 Feb 2017 18:30:17 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <170212101717.ZM1441@torch.brasslantern.com> References: <170212101717.ZM1441@torch.brasslantern.com> From: Timothee Cour Date: Sun, 12 Feb 2017 18:30:16 -0800 Message-ID: Subject: Re: implementation of <() (creating a temp fifo) ? To: Bart Schaefer Cc: Zsh Users Content-Type: multipart/alternative; boundary=001a113ea8cc67870b0548603afb --001a113ea8cc67870b0548603afb Content-Type: text/plain; charset=UTF-8 thanks! On Sun, Feb 12, 2017 at 10:17 AM, Bart Schaefer wrote: > On Feb 12, 4:32am, Timothee Cour wrote: > } > } Could someone kindly point me source code showing how zsh implements <() > } (temporary named pipe creation)? (ideally a url) > } > } * my workaround is to use tempnam but docs says it's not recommended ( > } http://man7.org/linux/man-pages/man3/tempnam.3.html) > > There doesn't seem to be any better option for a temporary named pipe. > mkfifo is relatively safe because there's no way to cause it to re-use > an existing fifo, so as long as you're confident that the directory > where the fifo is placed cannot itself be spoofed, using tempnam is OK. > > Note that the default build mode for zsh is to instead use /dev/fd/ or > the equivalent to get a handle to the stdin or stdout of the process, > and not use a named pipe at all. > > Also since any process can connect to a named pipe once it exists, be > sure you're passing appropriately restrictive file modes to mkfifo. > > To answer your direct question: > > https://sourceforge.net/p/zsh/code/ci/master/tree/Src/exec.c > search for "namedpipe" > > https://sourceforge.net/p/zsh/code/ci/master/tree/Src/utils.c > search for "gettempname" > --001a113ea8cc67870b0548603afb--