--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: A suggested method for fakeroot to handle "open" and "chroot"
- From: Shachar Shemesh <debian@shemesh.biz>
- Date: Thu, 29 Sep 2005 10:44:55 +0300
- Message-id: <E1EKt66-0003WP-00@spohr.debian.org>
Package: fakeroot
Version: 1.2.10
Severity: wishlist
Revise the method in which fakeroot communicates with the faked daemon:
- The library will not override any of the libc symbols. Instead, a
"syscall" type table is held inside.
- During the preload stage, fakeroot opens a socket/whatever to the
daemon, and asks it to ptrace the process. It also passes the daemon
the address of the symbol table.
- The daemon knows what socket number the process uses to communicate
with it (probably a high value to avoid collision. We'll assume it's
510).
- Whenever a "write" with fd "510" is registered at the debugging
daemon, the content is pulled from the process memory and placed in
the appropriate registers. This allows the library to perform system
calls directly.
- (Almost) any other syscall is redirected to the library for
interception and possibly replacement.
Advantages:
- Can intercept "open" without races.
- Can emulate "chroot".
- Can emulate root for statically linked and non-standard executeables.
- Can kill all faked processes when the daemon is killed.
- Can emulate a no-LD_PRELOAD environment (remove variable on SO load,
restore it upon execve). Also - can make sure that our LD_PRELOAD is
always first.
Disadvantages:
- Performance? Probably not serious, as only syscalls will ever trigger a
ptrace breakpoint.
- Will probably cause problems for recursive debuggers (i.e. - cannot
run "strace" inside fakeroot).
-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.8-2-686
Locale: LANG=en_US, LC_CTYPE=he_IL (charmap=ISO-8859-8)
Versions of packages fakeroot depends on:
ii libc6 2.3.2.ds1-22 GNU C Library: Shared libraries an
-- no debconf information
--- End Message ---