From: Jeremy Evans <code@jeremyevans.net>
To: Eric Wong <e@80x24.org>
Cc: unicorn-public@bogomips.org
Subject: Re: Patch: Add support for chroot to Worker#user V2
Date: Tue, 4 Apr 2017 21:57:33 -0700 [thread overview]
Message-ID: <20170405045733.GF1318@jeremyevans.local> (raw)
In-Reply-To: <20170405034444.GA7010@starla>
On 04/05 03:44, Eric Wong wrote:
> Jeremy Evans <code@jeremyevans.net> wrote:
> > @@ -134,6 +136,11 @@ def user(user, group = nil)
> > Process.initgroups(user, gid)
> > Process::GID.change_privilege(gid)
> > end
> > + if chroot
> > + chroot = Dir.pwd if chroot == true
> > + Dir.chroot(chroot)
> > + Dir.chdir('/')
> > + end
>
> By the way, I noticed in configurator.rb (for
> working_directory), we also update ENV['PWD'] after chdir.
>
> Perhaps we should do so, here?
That makes sense to me, though I don't use ENV['PWD'] personally.
> For working_directory, I preserved ENV['PWD'] in case Dir.pwd
> wasn't aware of symlinks; or there's code which relies on
> env['PWD'] without caring for making the syscalls required for
> Dir.pwd...
>
> I'm not sure how much it matters in practice...
I'm not either, but I don't see how it could hurt.
Thanks,
Jeremy
prev parent reply other threads:[~2017-04-05 4:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-23 18:46 Patch: Add support for chroot to Worker#user V2 Jeremy Evans
2017-04-05 3:44 ` Eric Wong
2017-04-05 4:57 ` Jeremy Evans [this message]
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
List information: https://yhbt.net/unicorn/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170405045733.GF1318@jeremyevans.local \
--to=code@jeremyevans.net \
--cc=e@80x24.org \
--cc=unicorn-public@bogomips.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://yhbt.net/unicorn.git/
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 read-only IMAP folder(s) and NNTP newsgroup(s).