unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: Jeremy Evans <code@jeremyevans.net>
Cc: unicorn-public@bogomips.org
Subject: Re: Patch: Add support for chroot to Worker#user V2
Date: Wed, 5 Apr 2017 03:44:44 +0000	[thread overview]
Message-ID: <20170405034444.GA7010@starla> (raw)
In-Reply-To: <20170223184605.GA67612@jeremyevans.local>

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?

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...

  reply	other threads:[~2017-04-05  3:44 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 [this message]
2017-04-05  4:57   ` Jeremy Evans

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=20170405034444.GA7010@starla \
    --to=e@80x24.org \
    --cc=code@jeremyevans.net \
    --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).