diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-02-18 01:53:16 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-02-18 02:33:20 -0500 |
commit | 111add353415f7ec08207ef1654327c19887e189 (patch) | |
tree | bb11408b9f6e04999c28f5b20c40931da5329f57 | |
parent | libsandbox: convert internal open func to sb_unwrapped_foo style (diff) | |
download | sandbox-111add353415f7ec08207ef1654327c19887e189.tar.gz sandbox-111add353415f7ec08207ef1654327c19887e189.tar.bz2 sandbox-111add353415f7ec08207ef1654327c19887e189.zip |
libsandbox: avoid recursion by using sb_unwrapped_access()
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r-- | libsandbox/libsandbox.c | 2 | ||||
-rw-r--r-- | libsandbox/wrappers.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/libsandbox/libsandbox.c b/libsandbox/libsandbox.c index 0cf469a..595d17f 100644 --- a/libsandbox/libsandbox.c +++ b/libsandbox/libsandbox.c @@ -665,7 +665,7 @@ static int check_access(sbcontext_t *sbcontext, int sb_nr, const char *func, con * behavior category, so no need to check the syscall. */ char *dname_buf = strdup(resolv_path); - int aret = access(dirname(dname_buf), F_OK); + int aret = sb_unwrapped_access(dirname(dname_buf), F_OK); free(dname_buf); if (aret) { result = 1; diff --git a/libsandbox/wrappers.h b/libsandbox/wrappers.h index 9524d70..1b32662 100644 --- a/libsandbox/wrappers.h +++ b/libsandbox/wrappers.h @@ -17,6 +17,8 @@ void *get_dlsym(const char *, const char *); /* Wrapper for internal use of functions in libsandbox. Should really * autogenerate this header ... */ +#define sb_unwrapped_access sb_unwrapped_access_DEFAULT +attribute_hidden int sb_unwrapped_access (const char *, int); #define sb_unwrapped_getcwd sb_unwrapped_getcwd_DEFAULT attribute_hidden char *sb_unwrapped_getcwd (char *, size_t); #define sb_unwrapped_open sb_unwrapped_open_DEFAULT |