expose use_safe_putenv via Proxmox::Lib::PMG

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2023-10-06 09:09:36 +02:00
parent c8d4db7836
commit a04d26b0d2

View File

@ -14,4 +14,12 @@ mod export {
pub fn init() { pub fn init() {
common::logger::init("PMG_LOG", "info"); common::logger::init("PMG_LOG", "info");
} }
/// CLI tools should call this very early. This is a workaround causing environment variable
/// manipulation to leak instead of crash. Required when calling into rust code that causes
/// `setenv` calls, particularly code using the openssl crate.
#[export]
pub fn use_safe_putenv() {
perlmod::ffi::use_safe_putenv(true);
}
} }