mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-15 18:10:23 +00:00
Modernize database code (again)
This commit is contained in:
@@ -33,7 +33,7 @@ static inline const char *get_command(const struct su_request *to) {
|
||||
|
||||
static void silent_run(const char **args, struct su_info *info) {
|
||||
char component[128];
|
||||
sprintf(component, "%s/a.h", info->str[SU_MANAGER]);
|
||||
sprintf(component, "%s/a.h", info->str[SU_MANAGER].data());
|
||||
args[5] = component;
|
||||
exec_t exec {
|
||||
.pre_exec = []() -> void {
|
||||
|
@@ -23,9 +23,9 @@ public:
|
||||
int count; /* Just a count for debugging purpose */
|
||||
|
||||
/* These values should be guarded with internal lock */
|
||||
struct db_settings cfg;
|
||||
struct db_strings str;
|
||||
struct su_access access;
|
||||
db_settings cfg;
|
||||
db_strings str;
|
||||
su_access access;
|
||||
struct stat mgr_st;
|
||||
|
||||
/* These should be guarded with global cache lock */
|
||||
|
@@ -63,8 +63,8 @@ void su_info::deRef() {
|
||||
|
||||
static void database_check(su_info *info) {
|
||||
int uid = info->uid;
|
||||
get_db_settings(&info->cfg);
|
||||
get_db_strings(&info->str);
|
||||
get_db_settings(info->cfg);
|
||||
get_db_strings(info->str);
|
||||
|
||||
// Check multiuser settings
|
||||
switch (info->cfg[SU_MULTIUSER_MODE]) {
|
||||
@@ -83,7 +83,7 @@ static void database_check(su_info *info) {
|
||||
}
|
||||
|
||||
if (uid > 0)
|
||||
get_uid_policy(uid, &info->access);
|
||||
get_uid_policy(uid, info->access);
|
||||
|
||||
// We need to check our manager
|
||||
if (info->access.log || info->access.notify)
|
||||
|
Reference in New Issue
Block a user