Pgsql was using bitwise operations to assign password output config to
its context flags, but mixing that with logic negation of the default
value, resulting in the expressions having a constant value as result.
Bug: #5007
use crate::pgsql::pgsql::*;
use std;
-pub const PGSQL_LOG_PASSWORDS: u32 = BIT_U32!(1);
+pub const PGSQL_LOG_PASSWORDS: u32 = BIT_U32!(0);
fn log_pgsql(tx: &PgsqlTransaction, flags: u32, js: &mut JsonBuilder) -> Result<(), JsonError> {
js.set_uint("tx_id", tx.tx_id)?;
#include "output-json-pgsql.h"
#include "rust.h"
-#define PGSQL_LOG_PASSWORDS BIT_U32(1)
+#define PGSQL_LOG_PASSWORDS BIT_U32(0)
typedef struct OutputPgsqlCtx_ {
uint32_t flags;
if (ConfValIsTrue(query)) {
pgsqllog_ctx->flags |= PGSQL_LOG_PASSWORDS;
} else {
- pgsqllog_ctx->flags &= !PGSQL_LOG_PASSWORDS;
+ pgsqllog_ctx->flags &= ~PGSQL_LOG_PASSWORDS;
}
} else {
- pgsqllog_ctx->flags &= !PGSQL_LOG_PASSWORDS;
+ pgsqllog_ctx->flags &= ~PGSQL_LOG_PASSWORDS;
}
}