$NetBSD: patch-ae,v 1.4 2013/01/18 00:34:30 mef Exp $ See http://gnats.netbsd.org/18771 mtools drops its privileges so thoroughly that it can't regain its original effective group id for opening the device file. This defeats the "setgid mtools" setup that is mentioned in the documentation and described in the comment above Setuid() in privileges.c. --- privileges.c.orig 2003-12-11 18:07:44.000000000 +0000 +++ privileges.c @@ -68,7 +68,7 @@ void reclaim_privs(void) { if(noPrivileges) return; - setgid(egid); + setegid(egid); Setuid(euid); print_privs("after reclaim privs, both uids should be 0 "); } @@ -76,7 +76,7 @@ void reclaim_privs(void) void drop_privs(void) { Setuid(ruid); - setgid(rgid); + setegid(rgid); print_privs("after drop_privs, real should be 0, effective should not "); }