src/ruby_supportlib/phusion_passenger/config/installation_utils.rb
# When creating PhusionPassenger.support_binaries_dir, preserve the
# parent directory's UID and GID. This way, running `passenger-config compile-agent`
# with sudo privilege, even though Phusion Passenger isn't installed as root,
# won't mess up permissions.
When creating PhusionPassenger.support_binaries_dir, preserve the
parent directory's UID and GID. This way, running `passenger-config compile-agent`
with sudo privilege, even though Phusion Passenger isn't installed as root,
won't mess up permissions.
When creating PhusionPassenger . support_binaries_dir preserve the parent directory ' s UID and GID . This way running ` passenger - config compile - agent ` with sudo privilege even though Phusion Passenger isn ' t installed as root won ' t mess up permissions .
def mkdir_p_preserve_parent_owner(path)
        Pathname.new(path).descend do |subpath|
          if !subpath.exist?
            stat = subpath.parent.stat
            Dir.mkdir(subpath.to_s)
            if Process.euid == 0
              File.lchown(stat.uid, stat.gid, subpath.to_s)
            end
          end
        end
      end
def mkdir_p_preserve_parent_owner ( path ) Pathname . new ( path ) . descend do | subpath | if ! subpath . exist? stat = subpath . parent . stat Dir . mkdir ( subpath . to_s ) if Process . euid == 0 File . lchown ( stat . uid , stat . gid , subpath . to_s ) end end end end
When creating PhusionPassenger.support_binaries_dir, preserve the
parent directory's UID and GID.
When creating PhusionPassenger . support_binaries_dir preserve the parent directory ' s UID and GID .
path