luvit/luvit — pull request #350 by greenITea (2012-10-05 09:38:21+00:00)
Title: UID and GID management for POSIX

I was missing functions for dropping privileges in luvit. It is just a native implementation, because luvit does not have a process module yet like in nodejs. My test program:

local process = require("uv_native")

local uid = process.getuid()
local gid = process.getgid()

print("UID: " .. uid .. " GID: " .. gid )

process.setgid(1000)

uid = process.getuid()
gid = process.getgid()

print("UID: " .. uid .. " GID: " .. gid )

process.setuid(1000)

uid = process.getuid()
gid = process.getgid()

print("UID: " .. uid .. " GID: " .. gid )