From: Bart Schaefer <schaefer@brasslantern.com>
To: Roman Perepelitsa <roman.perepelitsa@gmail.com>
Cc: LitHack <lithack0@gmail.com>, zsh-workers@zsh.org
Subject: Re: Random file creation in zsh shell.
Date: Sun, 18 Jun 2023 17:21:05 -0700 [thread overview]
Message-ID: <CAH+w=7aq9zJ7DN6ytvVVKjmo+X3-faT59J=9M0+Xn7duGVWiaQ@mail.gmail.com> (raw)
In-Reply-To: <CAN=4vMogHHEb_P7GwkanFyH8L2Q4jwijz9s2Zz8ZEzaMOULhwQ@mail.gmail.com>
On Fri, Jun 16, 2023 at 11:36 PM Roman Perepelitsa
<roman.perepelitsa@gmail.com> wrote:
>
> On Sat, Jun 17, 2023 at 4:04 AM LitHack <lithack0@gmail.com> wrote:
> >
> > There is a way to create a random file in zsh shell by which we could hide any of our data in it.
>
> Is it expected for `=true < =()` to leave a temporary file behind?
When an =(...) temp file is created, the parent shell assigns removal
to the child job, which is supposed to happen when the job exits. In
the case of a shell function or builtin, this works as expected. In
the case of an external command or a subshell that performs a "tail
call optimization" like your "( exec true )" example, the thread
that's meant to remove the temp file is replaced by a new process and
the exit-handler that would remove the file is lost.
I've spent quite a while on and off in the past prodding at the code
in exec.c to try to convince it that when there is a temp file present
it should skip the execve() and instead fork()/wait() to be able to
remove the file at the end, but have never got it to work without
breaking something else.
next prev parent reply other threads:[~2023-06-19 0:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-17 2:03 LitHack
2023-06-17 4:55 ` Fwd: " LitHack
2023-06-17 6:36 ` Roman Perepelitsa
2023-06-19 0:21 ` Bart Schaefer [this message]
2023-06-19 0:24 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAH+w=7aq9zJ7DN6ytvVVKjmo+X3-faT59J=9M0+Xn7duGVWiaQ@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=lithack0@gmail.com \
--cc=roman.perepelitsa@gmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).