Hey,
On Fri, 2007-02-16 at 19:28 +0000, Daniel P. Berrange wrote:
On Fri, Feb 16, 2007 at 02:44:57PM +0000, Mark McLoughlin wrote:
> @@ -289,29 +375,38 @@ static int qemudListen(struct qemud_serv
> int uid;
>
> if ((uid = geteuid()) < 0) {
> + qemudLog(QEMUD_ERR, "You must run the daemon as root to use system
mode");
> return -1;
> }
This error message looks bogus. This codepath is the per-user unprivileged
session mode, and the error. And actually checking return value at all is
completely unneccesssary because geteuid() is guarenteed not to fail.
We do, however, need a check
if (geteuid() != 0) {
....
}
In the first half of the if() block in the qemudListen function to check for
root privs in system mode.
Okay, here's an attempt to clean up all this code - mostly to coalesce
the two system vs. user code paths into a single function, but also to
recursively create config dirs and fix up the problems you spotted.
Cheers,
Mark.