pmt: initial 2.3.0 update
Delete jni/Makefile
This commit is contained in:
19
jni/root.c
19
jni/root.c
@@ -20,22 +20,23 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <err.h>
|
||||
#include <sysexits.h>
|
||||
#define INC_MAIN_LIBS
|
||||
#define INC_DEBUGERS
|
||||
|
||||
#include <pmt.h>
|
||||
|
||||
extern struct pmt_langdb_general* current;
|
||||
extern struct pmt_langdb_general en;
|
||||
extern struct pmt_langdb_general tr;
|
||||
|
||||
/* root checker function */
|
||||
void check_root(void)
|
||||
{
|
||||
/* a quick, easy method to verify root */
|
||||
/* a quick, easy method for verifying root */
|
||||
if (getuid() != 0)
|
||||
{
|
||||
if (!pmt_force_mode) errx(EX_NOPERM, "root access could not be detected! Please run this binary with root.");
|
||||
else exit(EX_NOPERM);
|
||||
if (!pmt_force_mode) error(1, "%s", current->no_root);
|
||||
else exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user