Mirror of
forum.nim-lang.org
index
6145 :: setting file owner and running process as another user
[2020-04-03T16:14:38+02:00]
View Orginal
craigmj
(orginal)
[2020-04-03T16:14:38+02:00]
view original
Hi, I'm failing to find anything in the standard library that would allow me to set the owner:group of a file, or that would allow me to run a process as a different user. Is it there somewhere? Best, Craig
cblake
(orginal)
[2020-04-03T18:30:10+02:00]
view original
You wan the
posix
module. It has
chown
,
chmod
,
setuid
, etc.
cblake
(orginal)
[2020-04-03T18:56:29+02:00]
view original
Also, in terms of
setuid
, you may also find
cligen/posixUt.dropPrivilegeTo
useful in the
cligen
nimble package (also at
https://github.com/c-blake/cligen
) used for example by the nimble
kslog
package (also at
https://github.com/c-blake/kslog
).
craigmj
(orginal)
[2020-04-03T22:40:13+02:00]
view original
Thank you!!!