lib/ssltransportagent.rb
# this method drops the process's root privileges for security reasons
this method drops the process's root privileges for security reasons
this method drops the process ' s root privileges for security reasons
def drop_root_privileges(user_name, group_name, working_directory)
    if Process::Sys.getuid==0
      user = Etc::getpwnam(user_name)
      group = Etc::getgrnam(group_name)
      Dir.chdir(user.dir)
      Dir.chdir(working_directory) if not working_directory.nil?
      Process::GID.change_privilege(group.gid)
      Process::UID.change_privilege(user.uid)
    end
  end
def drop_root_privileges ( user_name , group_name , working_directory ) if Process :: Sys . getuid == 0 user = Etc :: getpwnam ( user_name ) group = Etc :: getgrnam ( group_name ) Dir . chdir ( user . dir ) Dir . chdir ( working_directory ) if not working_directory . nil? Process :: GID . change_privilege ( group . gid ) Process :: UID . change_privilege ( user . uid ) end end
this method drops the process's root privileges for security reasons
this method drops the process ' s root privileges for security reasons
# drop root privileges
user_name
<not_specific>
group_name
<not_specific>
working_directory
<not_specific>