const char *callerTime = NULL;
const char *callerUid = NULL;
char *ret = NULL;
- bool supportsuid = false;
+#ifndef PKCHECK_SUPPORTS_UID
static bool polkitInsecureWarned;
+#endif
if (!identity) {
virAccessError(VIR_ERR_ACCESS_DENIED,
}
#ifdef PKCHECK_SUPPORTS_UID
- supportsuid = true;
-#endif
- if (supportsuid) {
- if (virAsprintf(&ret, "%s,%s,%s", callerPid, callerTime, callerUid) < 0)
- goto cleanup;
- } else {
- if (!polkitInsecureWarned) {
- VIR_WARN("No support for caller UID with pkcheck. This deployment is known to be insecure.");
- polkitInsecureWarned = true;
- }
- if (virAsprintf(&ret, "%s,%s", callerPid, callerTime) < 0)
- goto cleanup;
+ if (virAsprintf(&ret, "%s,%s,%s", callerPid, callerTime, callerUid) < 0)
+ goto cleanup;
+#else
+ if (!polkitInsecureWarned) {
+ VIR_WARN("No support for caller UID with pkcheck. "
+ "This deployment is known to be insecure.");
+ polkitInsecureWarned = true;
}
+ if (virAsprintf(&ret, "%s,%s", callerPid, callerTime) < 0)
+ goto cleanup;
+#endif
cleanup:
virObjectUnref(identity);