From e6b3eb2570f0123338775e3f0f3d12ba9ae14863 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Wed, 8 Jan 2025 16:32:03 +1000 Subject: [PATCH] Add accessor for handle->disable_sandbox Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 6 ++++++ lib/libalpm/handle.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 7f7cf531..ce6c9570 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -2299,6 +2299,12 @@ int alpm_option_set_parallel_downloads(alpm_handle_t *handle, unsigned int num_s * @{ */ +/** Get the sandbox state + * @param handle the context handle + * @return 0 for enabled, 1 for disabled + */ +int alpm_option_get_disable_sandbox(alpm_handle_t *handle); + /** Enables/disables the sandbox. * @param handle the context handle * @param disable_sandbox 0 for enabled, 1 for disabled diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index e2f919f6..01e1d891 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -952,6 +952,12 @@ int SYMEXPORT alpm_option_set_parallel_downloads(alpm_handle_t *handle, return 0; } +int SYMEXPORT alpm_option_get_disable_sandbox(alpm_handle_t *handle) +{ + CHECK_HANDLE(handle, return -1); + return handle->disable_sandbox; +} + int SYMEXPORT alpm_option_set_disable_sandbox(alpm_handle_t *handle, unsigned short disable_sandbox) {