aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* precompile headers.h to speed up build slightlyMike Frysinger2012-07-032-0/+2
| | | | | | | Since all system headers are included by way of headers.h, we can pre-compile this to speed up the build up a bit. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sb_printf: expand feature set slightly and fix testingMike Frysinger2012-07-021-12/+36
| | | | | | | | | | This adds support for signed ll, unsigned z, l, and ll, hex l, and ll, ignores the # for hex output since this is what we do implicitly already. As for testing, looks like during the autogeneration of testsuite.list.at, the sb_printf test was lost. Restore it so it gets run again. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* significantly overhaul output helpersMike Frysinger2012-06-238-62/+321
| | | | | | | | | | | | | | | | | | | | There are a few major points we want to hit here: - have all output from libsandbox go through portage helpers when we are in the portage environment so that output is properly logged - convert SB_E{info,warn,error} to sb_e{info,warn,error} to match style of other functions and cut down on confusion - move all abort/output helpers to libsbutil so it can be used in all source trees and not just by libsandbox - migrate all abort points to the centralized sb_ebort helper Unfortunately, it's not terribly easy to untangle these into separate patches, but hopefully this shouldn't be too messy as much of it is mechanical: move funcs between files, and change the name of funcs that get called. URL: http://bugs.gentoo.org/278761 Reported-by: Mounir Lamouri <volkmar@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: create more defines for gcc attributesMike Frysinger2012-06-231-4/+4
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: drop beep supportMike Frysinger2012-06-231-3/+0
| | | | | | | | Almost no one has beep support turned on anymore, and ebeep in the main tree has been deprecated (meaning it wasn't found useful while building packages). So punt support for it from sandbox too. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: push down constructor initMike Frysinger2012-03-052-12/+1
| | | | | | | | | | | | | | Since every consumer of sb_open gets a copy of the sbio_open data, push the init of this into the .data section of the respective consumers to avoid the runtime overhead. This just leaves sandbox_lib setup in the constructor function, but that is only needed by the execve wrapper, so push down init of that to the existing sb_init logic which happens before our execve wrapper gets used. URL: http://bugs.gentoo.org/404013 Reported-by: Mike Gilbert <floppym@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: kill off unnecessary log_domain codeMike Frysinger2009-08-252-12/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: kill off confusing SB_WRITE macroMike Frysinger2009-08-251-9/+0
| | | | | | | The SB_WRITE() macro makes using sb_write() confusing, so convert the two small users and kill it off. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* drop force pic flagsMike Frysinger2009-08-251-2/+1
| | | | | | | The autotool build system already adds PIC where needed, so don't force our own -D/-f options. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* add -Wall to automake runs and fix falloutMike Frysinger2009-08-251-3/+2
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* setup local sandbox.d for running tests to avoid /etc/sandbox.dMike Frysinger2009-04-263-0/+25
| | | | | | | Always use local sandbox.d copy to avoid random /etc/sandbox.d issues like it doesn't exist, or has permission problems, or anything else. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: stop denying /etc/ld.so.preloadMike Frysinger2009-03-311-1/+0
| | | | | | | | The very old method of loading sandbox was via ld.so.preload, so it was added to default deny list. However, that's long dead, and since it does not conflict with LD_PRELOAD, no point in preventing access. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sb_print: add l (long) modifier supportMike Frysinger2009-03-181-2/+11
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: add an eqawarn() funcMike Frysinger2009-03-181-0/+1
| | | | | | | | Break out most of the QA static ELF warning code into a new eqawarn() func. This way we can handle dynamic stuff like calling portage's eqawarn func to handle dirty details like logging. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: dump exec QA static notice to /dev/ttyMike Frysinger2009-03-111-0/+1
| | | | | | | | | | Rather than dump the QA static notice to stderr when trying to execute a static binary, write directly to /dev/tty. This prevents breaking things like testsuites that validate the exact stderr output. URL: http://bugs.gentoo.org/261957 Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reported-by: Kent Fredric <kentfredric@gmail.com>
* bump common macros up to localdecls.h so tests can use themMike Frysinger2009-03-091-13/+0
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: delete the testing var after installv1.4Mike Frysinger2009-03-083-2/+5
| | | | | | | We don't want people to bypass normal mechanisms with the testing var, so zero out the name when installing the sandbox binary. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: add symlink tests and unify codeMike Frysinger2009-03-081-8/+13
| | | | | | | Add test cases for symlink behavior and unify some of the test code to make adding more test cases even easier. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: get scripts working in sandbox.shMike Frysinger2009-02-084-1/+35
| | | | | | | | | Make sure we source the local sandbox.{bashrc,conf} and we always make the helper functions available when testing even if we aren't interactive. Now we can run `make check` and test the local version of sandbox even when we are running under another sandbox env. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sb_printf: get z modifier working and fixup testsMike Frysinger2009-02-081-3/+9
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox/libsbutil: remove more useless error checks and var initsMike Frysinger2009-02-011-16/+0
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: remove unused /var/tmp dir handlingMike Frysinger2009-02-011-1/+0
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: cull more unused debug/string codeMike Frysinger2009-02-012-107/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: setup {offsetof,MIN,MAX} helper macros if they dont existMike Frysinger2009-01-291-0/+11
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: add fallback strndup() implementationMike Frysinger2009-01-291-0/+16
| | | | | | | | | | Not all systems provide strndup() in their C library, and getting rid of the last consumer is a bit painful atm, so just provide a simple replacement. URL: http://bugs.gentoo.org/256741 Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reported-by: Javier Villavicencio <the_paya@gentoo.org>
* libsbutil: find libsandbox.so in non-standard pathsMike Frysinger2009-01-261-1/+11
| | | | | | | | | | If installing sandbox into a non-standard location (and the library ends up in a non-standard path where the ELF loader does not search), then set the LD_PRELOAD variable to the full path. URL: http://bugs.gentoo.org/254358 Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reported-by: Jeremy Olexa <darkside@gentoo.org>
* libsandbox: optimize!Mike Frysinger2008-12-311-0/+2
| | | | | | | Kill off string operations where unnecessary, and convert the sets of prefixes to arrays that we can iterate over. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: cleanup x* memory functionsMike Frysinger2008-12-3111-175/+113
| | | | | | | | Pull the x* memory functions out of rcscripts and into libsbutil and change their style to match the rest of sbutil. Also add xzalloc() and xstrdup(), and convert pointless strndup() usage to strdup(). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox/libsbutil: link with -no-undefinedMike Frysinger2008-12-311-0/+1
| | | | | | | Since all symbols should be satisfied, link these libraries with the libtool flag -no-undefined. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: delete more unused code imported from rcscriptsMike Frysinger2008-12-3110-760/+3
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: drop remove() replacementMike Frysinger2008-12-312-27/+0
| | | | | | The remove() function is in POSIX, so drop our copy of it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: sb_close(): only reset errno when close() workedMike Frysinger2008-12-311-1/+2
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: simplify get_tmp_dir code a littleMike Frysinger2008-12-311-5/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: scrub more unused rcscripts codeMike Frysinger2008-11-2911-215/+0
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: drop bogus inline usageMike Frysinger2008-11-294-42/+32
| | | | | | | Remove inline markings from functions whose bodies are never available at the point of inline calculation (i.e. they're always external functions). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sp_printf: make sure all output goes to stderrMike Frysinger2008-11-282-6/+12
| | | | | | | All output (even "normal" messages) have to go to stderr so we don't inadvertently break shell scripts that are being passed via stdout. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sb_printf: handle NULL pointers for %sMike Frysinger2008-11-161-0/+2
| | | | | | if told to printf(%s) a NULL pointer, output "(null)" rather than crash Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sb_printf: implement %*s supportMike Frysinger2008-11-161-8/+26
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* unify SB_E{INFO,WARN,ERROR} functions and have them call the internal ↵Mike Frysinger2008-11-162-32/+30
| | | | | | sb_printf function Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: simple custom printf() replacementMike Frysinger2008-11-163-9/+170
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: drop some unused codeMike Frysinger2008-11-165-969/+0
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: unify duplicate log debug functionsMike Frysinger2008-11-163-42/+13
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* move build flags to configure rather than MakefileMike Frysinger2008-11-111-4/+5
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: convert to stdbool.hMike Frysinger2008-11-107-59/+54
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* fix grammar: do not exist -> does not existMike Frysinger2008-11-101-1/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: make sure we always let the ldso do the libsandbox searchMike Frysinger2008-11-091-4/+4
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* headers.h: consolidate all random system includes into one fileMike Frysinger2008-11-0919-107/+18
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cleanup whitespace and comments -- no functional changesMike Frysinger2008-11-0931-576/+107
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: drop log_domain volatile markingsMike Frysinger2008-11-091-1/+1
| | | | | | | There is no need to mark log_domain volatile as there is no long running function where we have to worry about reloading of the storage. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsbutil: use __func__ rather than __FUNCTION__Mike Frysinger2008-11-093-13/+13
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>