v4.0.0-rc7 - custom message support in is_process_root()
This commit is contained in:
parent
ce5189c94a
commit
4883c6ee08
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user