[Mono-dev] Dropping privileges in linux

Georgi Moskov g.moskov at gmail.com
Wed Dec 21 03:22:47 EST 2005


Hi all,

I am looking for a way to drop privileges of an assembly started as
'root' to a normal user. I found two possible solutions, but didn't
succeed with either of them ...

a) Using Syscall

   Syscall.setgid(1000);
   Syscall.setuid(1000);

   there 1000 is the uid and gid of an existing user.

b) Using WindowsIdentity the way it is described here:

   http://pages.infinit.net/ctech/20040405-1133.html

In either way I get a 'Segmentation fault' when I execute the
assembly. I think there are some kind of memory permissions involved,
because when I strace the execution of the assembly I see that the
actual seuid and setgid calls are executed.

Can anyone give me some hint what I'm doing wrong, or a way to surroud
the problem? I'm running Debian 3.1 with mono 1.1.10.

Thanks,
Georgi Moskov



More information about the Mono-devel-list mailing list