aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* libsandbox: use mmap directly for internal memoryMike Frysinger2009-10-261-1/+1
| | | | | | | | | | | | | | | Some packages that do library tricks like sandbox override the mmap() symbols. If their implementation ends up calling functions that sandbox has overridden, then we can easily hit an infinite loop. sb-fopen -> sb-malloc -> external mmap -> sb-open -> whoops! So for the internal memory functions, make sure we call directly to the C library's mmap() functions. This way our internal memory implementation should be free from external forces. URL: http://bugs.gentoo.org/290249 Reported-by: Diego E. Pettenò <flameeyes@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: rewrite RTLD_NEXT handlingMike Frysinger2009-10-261-21/+33
| | | | | | | | | | | | The commit 0a539b142f24 tried to fix RTLD_NEXT issues seen under certain kernel/glibc combos, but in reality all it did was force dlopening of the C library for every symbol lookup. So rewrite the code to handle things on the fly as needed -- if RTLD_NEXT returned a bum symbol, load the C library and try again. URL: http://bugs.gentoo.org/202765 URL: http://bugs.gentoo.org/206678 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: save/restore errno for hardenedv1.3.9Mike Frysinger2009-03-041-0/+4
| | | | | | | | | | | Since hardened systems may return -1 in the case of an error, but this isn't a "real" error, we need to save/restore errno. Otherwise we corrupt the errno value of the caller. This is a regression on hardened systems due to the recent commit bab59e2c which optimized symbol loading a bit. URL: http://bugs.gentoo.org/260765 Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reported-by: Magnus Granberg <zorry@ume.nu>
* libsandbox: shuffle/unify local prototypesMike Frysinger2009-02-181-16/+13
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: convert internal open func to sb_unwrapped_foo styleMike Frysinger2009-02-181-22/+0
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: convert internal getcwd func to sb_unwrapped_foo styleMike Frysinger2009-02-181-8/+0
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: do save/restore errno in sym lookupMike Frysinger2009-02-181-2/+0
| | | | | | | | If the symbol lookup function failed, then we abort. If the lookup worked, then errno is not touched. In either case, there is no need to save/restore the errno value. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: convert more code to stdbool to simplify thingsMike Frysinger2009-02-151-1/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: fixup style/warnings in previous commitMike Frysinger2008-11-091-6/+6
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: fix symbol loading on hardened systemsRobin Johnson2008-11-091-6/+12
| | | | | | | | | | It seems that on hardened systems, USE_RTLD_NEXT is not always usable, and this trips up sandbox. URL: http://bugs.gentoo.org/206678 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Ned Lud <solar@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* headers.h: consolidate all random system includes into one fileMike Frysinger2008-11-091-21/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cleanup whitespace and comments -- no functional changesMike Frysinger2008-11-091-20/+3
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Split wrappers out to make modifying easier.Martin Schlemmer2006-07-131-610/+18
| | | | Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
* Add patch for using open() to test if the file exists, bug #135745.Martin Schlemmer2006-07-121-0/+40
| | | | | | URL: http://bugs.gentoo.org/135745 Signed-off-by: Martin Schlemmer <azarah@gentoo.org> Reported-by: Torbjörn Svensson <azoff@se.linux.org>
* Update copyright in case something from InstallWatch are still in here.Martin Schlemmer2006-07-101-0/+3
| | | | Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
* Add wrapper for internal use of getcwd().Martin Schlemmer2006-07-101-0/+7
| | | | Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
* Move wrappers out of libsandbox.c. Move IO functions toMartin Schlemmer2006-07-101-0/+678
libsbutil. Signed-off-by: Martin Schlemmer <azarah@gentoo.org>