mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-17 21:47:37 +00:00
Hardcode shell uid to 2000
This commit is contained in:
parent
e31e687602
commit
f109038d12
@ -17,14 +17,6 @@
|
|||||||
#include <logging.h>
|
#include <logging.h>
|
||||||
#include <utils.h>
|
#include <utils.h>
|
||||||
|
|
||||||
unsigned get_shell_uid() {
|
|
||||||
struct passwd* ppwd = getpwnam("shell");
|
|
||||||
if (nullptr == ppwd)
|
|
||||||
return 2000;
|
|
||||||
|
|
||||||
return ppwd->pw_uid;
|
|
||||||
}
|
|
||||||
|
|
||||||
int fork_dont_care() {
|
int fork_dont_care() {
|
||||||
int pid = xfork();
|
int pid = xfork();
|
||||||
if (pid) {
|
if (pid) {
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define UID_SHELL (get_shell_uid())
|
|
||||||
#define UID_ROOT 0
|
#define UID_ROOT 0
|
||||||
|
#define UID_SHELL 2000
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned get_shell_uid();
|
|
||||||
int fork_dont_care();
|
int fork_dont_care();
|
||||||
int fork_no_zombie();
|
int fork_no_zombie();
|
||||||
int strend(const char *s1, const char *s2);
|
int strend(const char *s1, const char *s2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user