run clang-format

This commit is contained in:
Jörg Thalheim
2024-12-11 15:13:24 +01:00
committed by Mic92
parent 64f537c22d
commit 7c76b52a8d
2 changed files with 20 additions and 20 deletions

View File

@@ -1,10 +1,10 @@
#define _GNU_SOURCE #define _GNU_SOURCE
#include <dlfcn.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/types.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); typedef struct passwd *(*getpwnam_type)(const char *name);

View File

@@ -6,27 +6,27 @@
typedef uint32_t uid_t; typedef uint32_t uid_t;
#ifdef __APPLE__ #ifdef __APPLE__
struct dyld_interpose { struct dyld_interpose {
const void * replacement; const void *replacement;
const void * replacee; const void *replacee;
}; };
#define WRAPPER(ret, name) static ret _fakeroot_wrapper_##name #define WRAPPER(ret, name) static ret _fakeroot_wrapper_##name
#define WRAPPER_DEF(name) \ #define WRAPPER_DEF(name) \
__attribute__((used)) static struct dyld_interpose _fakeroot_interpose_##name \ __attribute__(( \
__attribute__((section("__DATA,__interpose"))) = { &_fakeroot_wrapper_##name, &name }; used)) static struct dyld_interpose _fakeroot_interpose_##name \
__attribute__((section("__DATA,__interpose"))) = { \
&_fakeroot_wrapper_##name, &name};
#else #else
#define WRAPPER(ret, name) ret name #define WRAPPER(ret, name) ret name
#define WRAPPER_DEF(name) #define WRAPPER_DEF(name)
#endif #endif
WRAPPER(uid_t, geteuid)(const char * path, int flags, ...) WRAPPER(uid_t, geteuid)(const char *path, int flags, ...) {
{
return 0; // Fake root return 0; // Fake root
} }
WRAPPER_DEF(geteuid) 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 return 0; // Fake root
} }
WRAPPER_DEF(getuid) WRAPPER_DEF(getuid)