On 06/03/2011 01:11 AM, Matthias Bolte wrote:
That might be the problem. I don't have a Solaris at hand right
now to
test it so here is a speculative patch for this.
And while I have access to a Solaris machine, I don't have enough
pre-requisites built on it in order to build libvirt, so I likewise am
not in a position to test. Ruben, it would be nice to have your ACK.
qemudSetupPrivs() drops privileges on Solaris making geteuid()
return non-zero later on when qemudInitialize() tries to detect
privileged mode.
Detect privileged mode before calling qemudSetupPrivs() to fix
this.
In principle, this sounds like the right solution.
@@ -3300,8 +3302,12 @@ int main(int argc, char **argv) {
* getuid/geteuid() == 0, for privilege level checks.
* It must all use the flag 'server->privileged'
* which is also passed into all libvirt stateful
- * drivers
+ * drivers.
+ * Detect geteuid() == 0 before calling qemudSetupPrivs()
+ * because that might drop privileges.
*/
+ privileged = geteuid() == 0 ? 1 : 0;
Identical, and simpler, to just write:
privileged = !geteuid();
ACK by code inspection, but I'd prefer actual build test before
committing this. It qualifies for inclusion in 0.9.2 if we act fast
enough, but I don't think it is a show-stopper if we miss out on Solaris
builds for this release.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org