From: Adam Chlipala Date: Sun, 25 Feb 2007 21:04:33 +0000 (+0000) Subject: Allow DOMTOOL_USER environment variable, to specify Domtool identity X-Git-Tag: release_2010-11-19~248 X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/commitdiff_plain/573a0ebcce44a8b4ab34e76ffbf6fac6bbf4408f?ds=inline Allow DOMTOOL_USER environment variable, to specify Domtool identity --- diff --git a/src/main.sml b/src/main.sml index ca57210..0be3112 100644 --- a/src/main.sml +++ b/src/main.sml @@ -172,8 +172,15 @@ val self = fun requestContext f = let - val uid = Posix.ProcEnv.getuid () - val user = Posix.SysDB.Passwd.name (Posix.SysDB.getpwuid uid) + val user = + case Posix.ProcEnv.getenv "DOMTOOL_USER" of + NONE => + let + val uid = Posix.ProcEnv.getuid () + in + Posix.SysDB.Passwd.name (Posix.SysDB.getpwuid uid) + end + | SOME user => user val () = Acl.read Config.aclFile val () = Domain.setUser user