mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-02 09:11:18 +02:00
Fix portability issue in pg_audit.
"%ld" is not a portable way to print int64's. This may explain the buildfarm crashes we're seeing --- it seems to make dromedary happy, at least.
This commit is contained in:
parent
6c9e93d3ff
commit
35a1e1d159
@ -384,7 +384,7 @@ stack_pop(int64 stackId)
|
|||||||
if (auditEventStack != NULL && auditEventStack->stackId == stackId)
|
if (auditEventStack != NULL && auditEventStack->stackId == stackId)
|
||||||
MemoryContextDelete(auditEventStack->contextAudit);
|
MemoryContextDelete(auditEventStack->contextAudit);
|
||||||
else
|
else
|
||||||
elog(ERROR, "pg_audit stack item %ld not found on top - cannot pop",
|
elog(ERROR, "pg_audit stack item " INT64_FORMAT " not found on top - cannot pop",
|
||||||
stackId);
|
stackId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -403,10 +403,9 @@ stack_valid(int64 stackId)
|
|||||||
|
|
||||||
/* If we didn't find it, something went wrong. */
|
/* If we didn't find it, something went wrong. */
|
||||||
if (nextItem == NULL)
|
if (nextItem == NULL)
|
||||||
elog(ERROR, "pg_audit stack item %ld not found - top of stack is %ld",
|
elog(ERROR, "pg_audit stack item " INT64_FORMAT " not found - top of stack is " INT64_FORMAT "",
|
||||||
stackId, auditEventStack == NULL ? -1 : auditEventStack->stackId);
|
stackId,
|
||||||
|
auditEventStack == NULL ? (int64) -1 : auditEventStack->stackId);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -672,13 +671,19 @@ log_audit_event(AuditEventStackItem *stackItem)
|
|||||||
appendStringInfoString(&auditStr,
|
appendStringInfoString(&auditStr,
|
||||||
"<previously logged>,<previously logged>");
|
"<previously logged>,<previously logged>");
|
||||||
|
|
||||||
/* Log the audit entry */
|
/*
|
||||||
elog(auditLogLevel, "AUDIT: %s,%ld,%ld,%s,%s",
|
* Log the audit entry. Note: use of INT64_FORMAT here is bad for
|
||||||
|
* translatability, but we currently haven't got translation support in
|
||||||
|
* pg_audit anyway.
|
||||||
|
*/
|
||||||
|
ereport(auditLogLevel,
|
||||||
|
(errmsg("AUDIT: %s," INT64_FORMAT "," INT64_FORMAT ",%s,%s",
|
||||||
stackItem->auditEvent.granted ?
|
stackItem->auditEvent.granted ?
|
||||||
AUDIT_TYPE_OBJECT : AUDIT_TYPE_SESSION,
|
AUDIT_TYPE_OBJECT : AUDIT_TYPE_SESSION,
|
||||||
stackItem->auditEvent.statementId,
|
stackItem->auditEvent.statementId,
|
||||||
stackItem->auditEvent.substatementId,
|
stackItem->auditEvent.substatementId,
|
||||||
className, auditStr.data);
|
className,
|
||||||
|
auditStr.data)));
|
||||||
|
|
||||||
stackItem->auditEvent.logged = true;
|
stackItem->auditEvent.logged = true;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user