module Process::Daemon::Privileges

def self.change_user(user)

or a user name.
Set the user of the current process. Supply either a user ID
def self.change_user(user)
	if user.kind_of?(String)
		user = Etc.getpwnam(user).uid
	end
	Process::Sys.setuid(user)
end

def self.current_user

Get the user of the current process. Returns the user name.
def self.current_user
	uid = Process::Sys.getuid
	Etc.getpwuid(uid).name
end