[Mono-dev] Dropping privileges in linux

Georgi Moskov g.moskov at gmail.com
Sat Dec 24 06:30:00 EST 2005


Hi Robert,

I understand that the problem is related to the linux setXid()
implementation in a multi-threaded environment but I also realise that
this behaviour shows only in certain situations. So can you please
give me some more information about your linux  and mono
installations:

- What version of mono are you using, did you compile mono yourself
and if yes with what parameters?
- What are your OS and kernel versions?
- What are your glibc, pthreads and mono's libgc versions?

Regards,
Georgi Moskov

On 12/21/05, Robert Jordan <robertj at gmx.net> wrote:
> Georgi,
>
> > 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.
>
> Both (a) and (b) work for me. You may delete root's .wapi
> directory and retry. If it still doesn't work, please post the
> native stack trace you can obtain with gdb.
>
> Robert
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>



More information about the Mono-devel-list mailing list