Ticket #39 (assigned enhancement)

Opened 11 months ago

Last modified 11 months ago

improve set_effective_user

Reported by: tmm1 Assigned to: raggi (accepted)
Priority: minor Milestone: EventMachine "Framework"
Keywords: Cc: wyhaines


swiftiply uses:

		def self.run_as(user = "nobody", group = "nobody")
			Process.initgroups(user,Etc.getgrnam(group).gid) if user and group
			::Process::GID.change_privilege(Etc.getgrnam(group).gid) if group
			::Process::UID.change_privilege(Etc.getpwnam(user).uid) if user
		rescue Errno::EPERM
			raise "Failed to change the effective user to #{user} and the group to #{group}"

maybe add a EM.run_as that supports groups, and rescues EPERM (incase you're already running as non-root)

Change History

06/30/08 20:12:59 changed by raggi

  • status changed from new to assigned.

Need to verify win32