updated check hook to use libc:c_char

This commit is contained in:
Suhas Thalanki
2025-05-19 18:18:01 -04:00
parent e5804eb3e6
commit 228d034d0c
2 changed files with 3 additions and 2 deletions

View File

@@ -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

View File

@@ -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 {