summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLauri Aarnio <lauri.aarnio@iki.fi>2007-10-19 00:01:39 +0300
committerLauri Leukkunen <lle@rahina.org>2007-10-30 19:13:29 +0200
commit7e176e0da0c3829ae20e1a50fc063d09ab6a0a10 (patch)
treef53d2e5296750b4ecf7e3d1c36b61ac8d62fb651 /include
parent805a59137992052912f0e365dc4271362f8262f3 (diff)
Fixed permission checking in exec* (and refactored "lower layers" of exec*)
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)
Diffstat (limited to 'include')
-rw-r--r--include/sb2.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/sb2.h b/include/sb2.h
index 7317d2e..4cac62a 100644
--- a/include/sb2.h
+++ b/include/sb2.h
@@ -13,7 +13,7 @@
int sb_next_execve(const char *filename, char *const argv [],
char *const envp[]);
-int do_exec(const char *orig_file, const char *file,
+int do_exec(const char *exec_fn_name, const char *orig_file, const char *file,
char *const *argv, char *const *envp);
int ld_so_run_app(char *file, char **argv, char *const *envp);