All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Barrett <dbarrett@quinthar.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Setting new user:group with -daemonize?
Date: Tue, 15 Jul 2008 16:09:27 -0700	[thread overview]
Message-ID: <487D2E27.1060809@quinthar.com> (raw)

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?

             reply	other threads:[~2008-07-15 23:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-15 23:09 David Barrett [this message]
2008-07-16  1:39 ` [Qemu-devel] Setting new user:group with -daemonize? Anthony Liguori
2008-07-16  2:14   ` David Barrett
2008-07-18 17:00     ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=487D2E27.1060809@quinthar.com \
    --to=dbarrett@quinthar.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.