[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r17279: {tor} Add in initgroups call to drop root's groups. (tor/trunk/contrib)



Author: mikeperry
Date: 2008-11-16 02:26:46 -0500 (Sun, 16 Nov 2008)
New Revision: 17279

Modified:
   tor/trunk/contrib/linux-tor-prio.sh
Log:

Add in initgroups call to drop root's groups.



Modified: tor/trunk/contrib/linux-tor-prio.sh
===================================================================
--- tor/trunk/contrib/linux-tor-prio.sh	2008-11-16 03:32:46 UTC (rev 17278)
+++ tor/trunk/contrib/linux-tor-prio.sh	2008-11-16 07:26:46 UTC (rev 17279)
@@ -23,6 +23,7 @@
 #
 # #include <unistd.h>
 # int main(int argc, char **argv) {
+# if(initgroups("tor", GID) == -1) { perror("initgroups"); return 1; }
 # if(setresgid(GID, GID, GID) == -1) { perror("setresgid"); return 1; }
 # if(setresuid(UID, UID, UID) == -1) { perror("setresuid"); return 1; }
 # execl("/bin/tor", "/bin/tor", "-f", "/etc/tor/torrc", NULL);