From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KIteK-0005Gn-OV for qemu-devel@nongnu.org; Tue, 15 Jul 2008 19:09:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KIteK-0005GZ-38 for qemu-devel@nongnu.org; Tue, 15 Jul 2008 19:09:36 -0400 Received: from [199.232.76.173] (port=57624 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KIteJ-0005GW-TF for qemu-devel@nongnu.org; Tue, 15 Jul 2008 19:09:35 -0400 Received: from yx-out-1718.google.com ([74.125.44.157]:40461) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KIteI-0005rV-Pd for qemu-devel@nongnu.org; Tue, 15 Jul 2008 19:09:35 -0400 Received: by yx-out-1718.google.com with SMTP id 3so1602796yxi.82 for ; Tue, 15 Jul 2008 16:09:34 -0700 (PDT) Message-ID: <487D2E27.1060809@quinthar.com> Date: Tue, 15 Jul 2008 16:09:27 -0700 From: David Barrett MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Setting new user:group with -daemonize? Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Is there any way to make the qemu process change users after daemonizing? Basically, I want to start it as root so I can have it "-redir" with a low port (80), and then change to a non-root user after daemonizing. Is there any way to do this currently? Thankfully it opens the -redir port before forking, so it looks like a straightforward change to vc.c: basically adding a call to "setuid()" and "setgid()" after the call to "chdir()" on line 8711. I'd update the -daemonize syntax as follows: -daemonize [user[:group]] Is there any interest in such a patch? -david PS: Why does it fork twice?