Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: implementation of <() (creating a temp fifo) ?
- X-seq: zsh-users 22457
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Timothee Cour <timothee.cour2@xxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: implementation of <() (creating a temp fifo) ?
- Date: Sun, 12 Feb 2017 10:17:17 -0800
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=brasslantern-com.20150623.gappssmtp.com
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=rJB/sS0gOhCSsAA61lhKQapqD7Oh99Qm7X8yWy8/ErU=; b=BWfvRoadvGVolUb0LDXONCcBWG9IwfnzRlF2A+JiXBWpZeMtHAH7nTPf9+chTKq2Wh XRhNdz/O60ZkNp/fLrV1PrzcnYkMy/m3fk2C3c4K2bplReu0PMiHiKntkvsHAa4IuWUI grmBB93XSGtym/vL80+GY5poRyuEcL1NO+dAPrNb2BHEjLthLGoH+deW4XlwypsRQa/U ejXvqCwyXjc+OB3ILHEb5cAg4zTp54xxYQAwHW57mUyWt8wfQYWYAyA6HK/cBeMKsdnG qrT+RDQRenlLfwmXoRtXcuZj+ZPYR5s576KXEi0P5VXWc6r4mO72OZIRAMLuFrRi2TPi LWrQ==
- In-reply-to: <CAM4j=kPjFCCWRJTL8Sw3Y4OAe__i6k=YXL40M-awwwR79ZCVBg@mail.gmail.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>
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