From 228d034d0c818dd60088d7922902bbd66afe8d81 Mon Sep 17 00:00:00 2001 From: Suhas Thalanki Date: Mon, 19 May 2025 18:18:01 -0400 Subject: [PATCH] updated check hook to use libc:c_char --- compute/compute-node.Dockerfile | 1 + compute/patches/anon_v2.patch | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/compute/compute-node.Dockerfile b/compute/compute-node.Dockerfile index 180cb7b6b6..fb73f8c996 100644 --- a/compute/compute-node.Dockerfile +++ b/compute/compute-node.Dockerfile @@ -1357,6 +1357,7 @@ RUN wget https://gitlab.com/dalibo/postgresql_anonymizer/-/archive/2.1.0/postgre find /usr/local/pgsql -type f | sed 's|^/usr/local/pgsql/||' > /before.txt && \ sed -i 's/pgrx = "0.14.1"/pgrx = { git = "https:\/\/github.com\/thesuhas\/pgrx.git", branch = "expose_guc_assign_hook", features = [ "unsafe-postgres" ] }/g' Cargo.toml && \ sed -i 's/pgrx-tests = "0.14.1"/pgrx-tests = { git = "https:\/\/github.com\/thesuhas\/pgrx.git", branch = "expose_guc_assign_hook" }/g' Cargo.toml && \ + sed -i '/\[dependencies\]/a libc = "0.2.172"' Cargo.toml && \ patch -p1 < /ext-src/anon_v2.patch FROM rust-extensions-build-pgrx14 AS pg-anon-pg-build diff --git a/compute/patches/anon_v2.patch b/compute/patches/anon_v2.patch index 67473398ab..ce2639cbd3 100644 --- a/compute/patches/anon_v2.patch +++ b/compute/patches/anon_v2.patch @@ -151,7 +151,7 @@ index 7da6553..7961984 100644 + +SECURITY LABEL FOR anon ON FUNCTION anon.toggle_transparent_dynamic_masking IS 'UNTRUSTED'; diff --git a/src/guc.rs b/src/guc.rs -index 74d3822..6dbd0bc 100644 +index 74d3822..7d57125 100644 --- a/src/guc.rs +++ b/src/guc.rs @@ -3,7 +3,7 @@ @@ -186,7 +186,7 @@ index 74d3822..6dbd0bc 100644 +} + + unsafe extern "C-unwind" fn check_string_guc_hook( -+ _newval: *mut *mut i8, ++ _newval: *mut *mut libc::c_char, + _extra: *mut *mut c_void, + _source: u32 + ) -> bool {