    # File lib/chef/daemon.rb, line 144
          def _change_privilege(user, group=user)
            uid, gid = Process.euid, Process.egid

            begin
              target_uid = Etc.getpwnam(user).uid
            rescue ArgumentError => e
              Chef::Application.fatal!("Failed to get UID for user #{user}, does it exist? #{e.message}")
              return false
            end

            begin
              target_gid = Etc.getgrnam(group).gid
            rescue ArgumentError => e
              Chef::Application.fatal!("Failed to get GID for group #{group}, does it exist? #{e.message}")
              return false
            end

            if (uid != target_uid) or (gid != target_gid)
              Process.initgroups(user, target_gid)
              Process::GID.change_privilege(target_gid)
              Process::UID.change_privilege(target_uid)
            end
            true
          rescue Errno::EPERM => e
            Chef::Application.fatal!("Permission denied when trying to change #{uid}:#{gid} to #{target_uid}:#{target_gid}. #{e.message}")
          end