Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: implementation of <() (creating a temp fifo) ?
- X-seq: zsh-users 22461
- From: Timothee Cour <timothee.cour2@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: implementation of <() (creating a temp fifo) ?
- Date: Sun, 12 Feb 2017 18:30:16 -0800
- Cc: Zsh Users <zsh-users@xxxxxxx>
- 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==
- In-reply-to: <170212101717.ZM1441@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAM4j=kPjFCCWRJTL8Sw3Y4OAe__i6k=YXL40M-awwwR79ZCVBg@mail.gmail.com> <170212101717.ZM1441@torch.brasslantern.com>
thanks!
On Sun, Feb 12, 2017 at 10:17 AM, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
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"
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author