From 0033f67e37d9715d116ba3bf0c9288e057ba30cf Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 4 Jun 2024 11:02:23 +0200 Subject: [PATCH] product-config: export get_api_user Signed-off-by: Dietmar Maurer --- proxmox-product-config/src/init.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/proxmox-product-config/src/init.rs b/proxmox-product-config/src/init.rs index 9135311f..afe45649 100644 --- a/proxmox-product-config/src/init.rs +++ b/proxmox-product-config/src/init.rs @@ -15,8 +15,12 @@ pub fn init(api_user: nix::unistd::User) { } } -/// Returns the global product configuration (see [init_product_config]) -pub(crate) fn get_api_user() -> &'static nix::unistd::User { +/// Returns the global api_user set with [init]. +/// +/// # Panics +/// +/// Panics if [init] wasn't called before. +pub fn get_api_user() -> &'static nix::unistd::User { unsafe { &PRODUCT_CONFIG .as_ref()