[libvirt] Building on Solaris 11 Express
Eric Blake
eblake at redhat.com
Fri Jun 3 14:16:56 UTC 2011
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 at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110603/8a18eda1/attachment-0001.sig>
More information about the libvir-list
mailing list