Age | Commit message (Collapse) | Author | Files | Lines |
|
- level "debug": shows if argv and/or envp has been changed
- level "noise": as above + logs all components of modified
string vectors.
- added SB_LOG_IS_ACTIVE(level) macro for testing if logging
has been enabled
|
|
It is now possible to add "readonly = true" to any mapping rule, and
the generated interface will then return an error code for any function
which is trying to modify the filesystem: The interface functions do not
call the real functions at all in this case, instead they will
return an error code (typically -1 for system calls, NULL for fopen() etc).
Also, errno will been set to appropriate value, typically to EROFS.
Other modifications:
- Added wrappers for fhchmod() [all platforms],
and chflags(), getattrlist(), and setattrlist [Mac OS X - untested!]
- Modified many of the wrapper specifications in interface.master
(hopefully found all functions that may modify the filesystem :-)
- Added new logging level "NOTICE", used for logging interface-generated
"read only errors"
- sb2-show now displays if the target has been marked "readonly" by the rules
- sb2-logz knows about "notice" messages
- added two new modifiers to gen-interface.pl (without these this R/O-thing
would not be possible at all)
- some minor code cleanups
|
|
- new option "-Q BUGLIST" to sb2 (ex. sb2 -Q x)
- currently this can emulate:
x: scratchbox1 didn't check X-permission of files correctly,
|
|
stop the madness!
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Simply edit your target.config:
export SBOX_CPUTRANSPARENCY_METHOD="/home/lleukkun/scratchbox2/bin/qemu-arm -s 512"
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
sb2-show allows you to inspect how path/argv/envp mangling
would be done for a given binary. Patch by
lauri.t.aarnio@nokia.com, somewhat cleaned up by
lle@rahina.org.
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
- added sb2logz, which extracts information from logs and produces summaries
- general: log format changed (each line now contains log level, too)
- *.c: log messages which are needed by sb2logz are now at INFO level
- interface.master & libsb2.c: Added gates to _exit() and _Exit(),
so that exit status can be logged
- sb_exec.c: bugfix: sb_execve_mod() returns nonzero if error, not zero
- sb2: location of log files changed: logs now go to ~/sb2_logs/,
and initial environment is printed to the log file
|
|
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
|
|
Still bombs out randomly for no apparent reason.
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
* Adds endian string suffix checking (sh4eb now ok).
* Adds code to check endian in the elf header.
* Makes sure host binary really is a host binary - prevents
executing sh4eb as host on sh4 target.
Patch by Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
This allows controlling build environment independently of
the host.
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
The unmapped file needs to be given at least to qemu to
ensure correct behaviour.
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
run_hashbang() calls do_exec() again to handle the interpreter
execution. Seems to work after superficial testing.
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Cleans the sequence by pushing hashbang detection further down
the pipeline, improves code structure and hopefully fixes some
breakage.
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
sb_gcc_wrapper functionality is now implemented directly in libsb2.so as
a lua script directly managing the execve(file, argv, envp) call.
Same functionality can be used to do other things as well, see for
the dpkg-architecture example in lua_scripts/argvenvp.lua
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
by Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
For now this is just a pass-through, doesn't do anything, but
from here it's just a matter of building up the lua scripts.
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Patch from Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
libsb2.c:
- Fixed a permission checking bug:
It used to require that a file can opened (has R permission). On the other
hand, it didn't check at all that the file had execution permission set.
The result was that scripts could be executed even when x-bit was not set,
and nothing could be executed without having r-bit set. This was fixed by
first calling access() before doing anything else with the executable,
and also allowing files with permissions like --x--x--x to be executed
(but those must be executed on the host, as binary type can not be checked
without opening the file).
- all logging calls in exec functions now print the correct name of the
original interface function
- removed three clones that collected argv[] for varargs-based exec variants;
replaced those with a subroutine
interface.master:
- added a modifier to access(), so that we'll get a "_nomap_nolog" version, too
sb_exec.c:
- includes libsb2.h and generated .h file
- inspect_binary now uses open_nomap_nolog() to open the file instead of open()
(the path has already been mapped there)
- added a parameter to do_exec() (name of the calling function, since there are
six different variants of exec)
|
|
|
|
|
|
|
|
|
|
Fakeroot and LD_PRELOAD in general not handled properly.
No configuration helpers yet.
|
|
Based on patch by Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
sb_log_init_logging is now sblog_init
sb_call_open_without_logging is now sb_open_nolog
Removes DBGOUT() macro, the new SB_LOG(level, msg...) should be used
instead. Small coding style issues, mainly with
if() -> if () and while() -> while ().
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
|
|
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
This should ease porting to non-linux hosts quite a bit.
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
This change passes the unmapped executable to qemu and
relies on qemu open()ing it, correct mapping will take
place at that time instead of the normal execve().
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Enables use of 32bit binaries on a 64bit host. Works just fine
the other way around as well.
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Removes obsolete/unused sb1 leftovers from sb_exec.c
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
|
|
Now it's passed even if the new process env pointer doesn't
have it, but only if it's set for ourselves. This makes
target processes starting new target processes work. Which is good.
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
path mangling is simply not going to do the right
thing.
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
This feature is not in qemu's CVS yet, patches are available
from http://freedesktop.org/Software/sbox2
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
This helps to implement proper mappings for the target
binaries.
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
|
|
|
|
|