diff --git a/src/libvirt-admin.c b/src/libvirt-admin.c index 4552e84a6e..03245b636f 100644 --- a/src/libvirt-admin.c +++ b/src/libvirt-admin.c @@ -179,11 +179,13 @@ virAdmGetDefaultURI(virConfPtr conf, char **uristr) * we set the default admin server URI to 'libvirtd:///system' or * 'libvirtd:///session' depending on the process's EUID. */ - if (geteuid() == 0 && - VIR_STRDUP(*uristr, "libvirtd:///system") < 0) + if (geteuid() == 0) { + if (VIR_STRDUP(*uristr, "libvirtd:///system") < 0) return -1; - else if (VIR_STRDUP(*uristr, "libvirtd:///session") < 0) + } else { + if (VIR_STRDUP(*uristr, "libvirtd:///session") < 0) return -1; + } } }