v4.0.0-rc7 - custom message support in is_process_root()

This commit is contained in:
Liam Waldron 2024-11-12 09:06:26 -05:00
parent ce5189c94a
commit 4883c6ee08
2 changed files with 5 additions and 4 deletions

View File

@ -1 +1 @@
4.0.0-rc6 4.0.0-rc7

View File

@ -47,6 +47,7 @@ int GLACIER_VERBOSE;
const char *GLACIER_REPO; const char *GLACIER_REPO;
const char *GLACIER_ARCH; const char *GLACIER_ARCH;
const char *GLACIER_TARGET; const char *GLACIER_TARGET;
const char *GLACIER_LOCALDB;
const char *GLACIER_SYSTEM_PROFILE; const char *GLACIER_SYSTEM_PROFILE;
const char *runtime_files[] = { const char *runtime_files[] = {
@ -172,16 +173,16 @@ runtime_exists()
* is_process_root * is_process_root
* *
* DESCRIPTION: Check if process is running as root. * DESCRIPTION: Check if process is running as root.
* PARAMETERS: None. * PARAMETERS: char MSG[]
* DEFINED IN: glacier_runtime.h * DEFINED IN: glacier_runtime.h
* *
*/ */
int int
is_process_root() is_process_root(char MSG[])
{ {
if (getuid() != 0) { if (getuid() != 0) {
errlog("Failed to open package index: permission denied. Are you root?"); fprintf(stderr, COL_RED "[x] " COL_RESET "%s\n", MSG);
exit(1); exit(1);
} }
} }