diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-02-18 02:02:10 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-02-18 02:39:21 -0500 |
commit | 9483901c8f7dff552dc26c0b3532f8e5065a5f61 (patch) | |
tree | 382e6c54ff1b3fe7b5038d61d507e9bf596a71e9 | |
parent | libsandbox: avoid recursion by using sb_unwrapped_access() (diff) | |
download | sandbox-9483901c8f7dff552dc26c0b3532f8e5065a5f61.tar.gz sandbox-9483901c8f7dff552dc26c0b3532f8e5065a5f61.tar.bz2 sandbox-9483901c8f7dff552dc26c0b3532f8e5065a5f61.zip |
libsandbox: shuffle/unify local prototypes
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r-- | libsandbox/libsandbox.h | 3 | ||||
-rw-r--r-- | libsandbox/wrappers.c | 29 | ||||
-rw-r--r-- | libsandbox/wrappers.h | 6 |
3 files changed, 17 insertions, 21 deletions
diff --git a/libsandbox/libsandbox.h b/libsandbox/libsandbox.h index ba05897..8ed6d70 100644 --- a/libsandbox/libsandbox.h +++ b/libsandbox/libsandbox.h @@ -45,6 +45,9 @@ bool before_syscall_access(int, int, const char *, const char *, int); bool before_syscall_open_int(int, int, const char *, const char *, int); bool before_syscall_open_char(int, int, const char *, const char *, const char *); +extern char sandbox_lib[SB_PATH_MAX]; +extern volatile bool sandbox_on; + /* glibc modified realpath() function */ char *erealpath(const char *, char *); char *egetcwd(char *, size_t); diff --git a/libsandbox/wrappers.c b/libsandbox/wrappers.c index 511aed5..29bd9d4 100644 --- a/libsandbox/wrappers.c +++ b/libsandbox/wrappers.c @@ -19,24 +19,9 @@ # define USE_RTLD_NEXT #endif -/* Macro to check if a wrapper is defined, if not - * then try to resolve it again. */ -#define check_dlsym(_name, _symname, _symver) \ -{ \ - if (NULL == _name) \ - _name = get_dlsym(_symname, _symver); \ -} - static void *libc_handle = NULL; -extern char sandbox_lib[SB_PATH_MAX]; -extern bool sandbox_on; - -/* Need to include the function wrappers here, as they are needed below */ -#include "symbols.h" - - -void *get_dlsym(const char *symname, const char *symver) +static void *get_dlsym(const char *symname, const char *symver) { void *symaddr = NULL; @@ -71,3 +56,15 @@ void *get_dlsym(const char *symname, const char *symver) return symaddr; } + +/* Macro to check if a wrapper is defined, if not + * then try to resolve it again. + */ +#define check_dlsym(_name, _symname, _symver) \ +{ \ + if (NULL == _name) \ + _name = get_dlsym(_symname, _symver); \ +} + +/* Need to include the function wrappers here, as they are needed below */ +#include "symbols.h" diff --git a/libsandbox/wrappers.h b/libsandbox/wrappers.h index 1b32662..22b073b 100644 --- a/libsandbox/wrappers.h +++ b/libsandbox/wrappers.h @@ -10,10 +10,6 @@ #ifndef __WRAPPERS_H__ #define __WRAPPERS_H__ -#include <libsandbox.h> - -void *get_dlsym(const char *, const char *); - /* Wrapper for internal use of functions in libsandbox. Should really * autogenerate this header ... */ @@ -24,4 +20,4 @@ attribute_hidden char *sb_unwrapped_getcwd (char *, size_t); #define sb_unwrapped_open sb_unwrapped_open_DEFAULT attribute_hidden int sb_unwrapped_open (const char *, int, mode_t); -#endif /* __WRAPPERS_H__ */ +#endif |