run clang-format
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <dlfcn.h>
|
||||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#include <dlfcn.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
typedef struct passwd *(*getpwnam_type)(const char *name);
|
||||
|
||||
|
||||
@@ -6,27 +6,27 @@
|
||||
typedef uint32_t uid_t;
|
||||
|
||||
#ifdef __APPLE__
|
||||
struct dyld_interpose {
|
||||
const void * replacement;
|
||||
const void * replacee;
|
||||
};
|
||||
#define WRAPPER(ret, name) static ret _fakeroot_wrapper_##name
|
||||
#define WRAPPER_DEF(name) \
|
||||
__attribute__((used)) static struct dyld_interpose _fakeroot_interpose_##name \
|
||||
__attribute__((section("__DATA,__interpose"))) = { &_fakeroot_wrapper_##name, &name };
|
||||
struct dyld_interpose {
|
||||
const void *replacement;
|
||||
const void *replacee;
|
||||
};
|
||||
#define WRAPPER(ret, name) static ret _fakeroot_wrapper_##name
|
||||
#define WRAPPER_DEF(name) \
|
||||
__attribute__(( \
|
||||
used)) static struct dyld_interpose _fakeroot_interpose_##name \
|
||||
__attribute__((section("__DATA,__interpose"))) = { \
|
||||
&_fakeroot_wrapper_##name, &name};
|
||||
#else
|
||||
#define WRAPPER(ret, name) ret name
|
||||
#define WRAPPER_DEF(name)
|
||||
#define WRAPPER(ret, name) ret name
|
||||
#define WRAPPER_DEF(name)
|
||||
#endif
|
||||
|
||||
WRAPPER(uid_t, geteuid)(const char * path, int flags, ...)
|
||||
{
|
||||
WRAPPER(uid_t, geteuid)(const char *path, int flags, ...) {
|
||||
return 0; // Fake root
|
||||
}
|
||||
WRAPPER_DEF(geteuid)
|
||||
|
||||
WRAPPER(uid_t, getuid)(const char * path, int flags, ...)
|
||||
{
|
||||
WRAPPER(uid_t, getuid)(const char *path, int flags, ...) {
|
||||
return 0; // Fake root
|
||||
}
|
||||
WRAPPER_DEF(getuid)
|
||||
|
||||
Reference in New Issue
Block a user