Date: Fri, 13 Sep 2002 22:01:48 +0200 From: Ernst de Haan <znerd@FreeBSD.org> To: audit@FreeBSD.org Cc: Ari Suutari <ari.suutari@syncrontech.com>, Kris Kennaway <kris@obsecurity.org>, java@FreeBSD.org Subject: daemonctl.c: setuid/setgid Message-ID: <200209132001.WAA09258@smtp.hccnet.nl>
next in thread | raw e-mail | index | archive | help
Dear audit :) Hereby I request a review of a patch for a daemon control program. The file in question is: ports/www/jakarta-tomcat4/files/daemonctl.c This program is specifically written for controlling the starting and stopping of Java-based web servers and application servers. The idea is that anyone in a certain group (typically group 'www') can call this program. The program will then assume a certain identity (typically user 'www') before starting the Java virtual machine. The daemonctl program is installed as both setuid and setgid. This daemonctl program is first preprocessed by the makefile to customize it for a certain web/application server. The daemonctl program is used for these ports: o Tomcat 3.x (www/jakarta-tomcat3) o Tomcat 4.0.x (www/jakarta-tomcat4) o Tomcat 4.1.x (www/jakarta-tomcat41) o Orion/stable (www/orion) o Orion/current (www/orion-devel) o JBoss 2.x (java/jboss2) o JBoss 3.x (java/jboss3) The problem is that a number of Java virtual machines need an environment to be set up before starting up. This includes the native FreeBSD JDK 1.3.1 (from ports/java/jdk13). A suggested solution (by Ari Suutari) is that at the beginning of the daemonctl program the following code is executed: setuid(geteuid()); setgid(getegid()) (Just above the ``argument = argv[1];'' line). I ask for this review because I don't know what the exact consequences of this are. Kris suggested that I should get this reviewed by audit. Is it okay to commit these changes or would they impact security? SEE ALSO: 1. The thread about this subject on freebsd-java: http://www.geocrawler.com/mail/thread.php3?subject=Jboss3ctl+update+%28I+think+I+know+the+problem%29&list=162 2. The CVS log for daemonctl.c: http://www.freebsd.org/cgi/cvsweb.cgi/ports/www/jakarta-tomcat4/files/daemonctl.c -- E: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209132001.WAA09258>